package com.thhy.mobile.modules.biz.repo.controller; import com.github.pagehelper.PageInfo; import com.thhy.general.common.BasicResult; import com.thhy.general.utils.PagingUtils; import com.thhy.mobile.modules.biz.repo.entity.*; import com.thhy.mobile.modules.biz.repo.service.RepoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.List; /** * @author zhang_xiao_bo * @since 2023-05-15 11:13:39 */ @RestController @RequestMapping("repo") public class RepoController { @Autowired private RepoService repoService; @RequestMapping("findList") public BasicResult findList(@RequestBody(required = false) Repo repo,HttpServletRequest req){ PagingUtils.setPageParam(req); List repoList = repoService.findList(repo); PageInfo pageInfo = new PageInfo<>(repoList); return BasicResult.success(pageInfo); } @RequestMapping("repoTypePullDown") public BasicResult repoTypePullDown(){ List> mapList = repoService.queryAllRepoType(); return BasicResult.success(mapList); } @RequestMapping("repoPullDown") public BasicResult repoPullDown(){ List repoPullDownVos = repoService.queryRepoPull(); return BasicResult.success(repoPullDownVos); } @RequestMapping("repoUnitPullDown") public BasicResult repoUnitPullDown(@RequestBody Repo repo){ List unitList = repoService.repoUnitPullDown(repo); return BasicResult.success(unitList); } @RequestMapping("addRepo") public BasicResult addRepo(@RequestBody RepoDto repoDto){ repoService.addRepo(repoDto); return BasicResult.success(); } /** @RequestMapping("update") public BasicResult update(@RequestBody Repo repo){ repoService.update(repo); return BasicResult.success(); }**/ @RequestMapping("delete") public BasicResult delete(@RequestBody Repo repo){ repoService.delete(repo.getRepoId()); return BasicResult.success(); } @RequestMapping("deleteUnit") public BasicResult deleteUnit(@RequestBody RepoUnit repoUnit){ repoService.deleteUnit(repoUnit); return BasicResult.success(); } }