| | |
| | | package tech.aiflowy.ai.controller; |
| | | |
| | | import com.mybatisflex.core.paginate.Page; |
| | | import com.mybatisflex.core.query.QueryWrapper; |
| | | import com.mybatisflex.core.table.TableInfo; |
| | | import com.mybatisflex.core.table.TableInfoFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import tech.aiflowy.ai.entity.AiSecondMenu; |
| | | import tech.aiflowy.ai.service.AiSecondMenuService; |
| | | import tech.aiflowy.common.domain.Result; |
| | | import tech.aiflowy.common.entity.LoginAccount; |
| | | import tech.aiflowy.common.satoken.util.SaTokenUtil; |
| | | import tech.aiflowy.common.tree.Tree; |
| | | import tech.aiflowy.common.web.controller.BaseCurdController; |
| | | import tech.aiflowy.common.web.jsonbody.JsonBody; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api/v1/aiMenu/SecondMenu") |
| | | public class AiSecondMenuController extends BaseCurdController<AiSecondMenuService, AiSecondMenu> { |
| | |
| | | } |
| | | |
| | | @Autowired |
| | | AiSecondMenuService AiSecondMenuService; |
| | | AiSecondMenuService aiSecondMenuService; |
| | | |
| | | @Override |
| | | public Result list(AiSecondMenu entity, Boolean asTree, String sortKey, String sortType) { |
| | | QueryWrapper queryWrapper = QueryWrapper.create(entity, buildOperators(entity)); |
| | | queryWrapper.orderBy(AiSecondMenu::getFirstMenuId); |
| | | List<AiSecondMenu> list = Tree.tryToTree(aiSecondMenuService.findAll(queryWrapper), asTree); |
| | | return Result.success(list); |
| | | } |
| | | protected Page<AiSecondMenu> queryPage(Page<AiSecondMenu> page, QueryWrapper queryWrapper) { |
| | | return service.page(page, queryWrapper); |
| | | } |
| | | } |