|
|
@@ -4,14 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.zhiqiyun.open.annotation.Permission;
|
|
|
-import com.zhiqiyun.open.core.models.cultural.tourism.OccupationInfo;
|
|
|
+import com.zhiqiyun.open.core.models.category.CategoryOccupation;
|
|
|
import com.zhiqiyun.open.core.models.user.OauthInfo;
|
|
|
+import com.zhiqiyun.open.core.service.CategoryOccupationService;
|
|
|
import com.zhiqiyun.open.core.service.OauthService;
|
|
|
-import com.zhiqiyun.open.core.service.OccupationInfoService;
|
|
|
import com.zhiqiyun.open.core.service.SequenceService;
|
|
|
import com.zhiqiyun.open.mvc.Result;
|
|
|
-import com.zhiqiyun.open.mvc.params.cultural.tourism.QueryOccupationInfoParam;
|
|
|
-import com.zhiqiyun.open.mvc.params.cultural.tourism.SaveOccupationInfoParam;
|
|
|
+import com.zhiqiyun.open.mvc.params.category.QueryCategoryOccupationParam;
|
|
|
+import com.zhiqiyun.open.mvc.params.category.SaveCategoryOccupationParam;
|
|
|
import com.zhiqiyun.open.utils.DateUtil;
|
|
|
import com.zhiqiyun.open.utils.ServletContext;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -26,11 +26,11 @@ import javax.validation.Valid;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RestController
|
|
|
-@RequestMapping("/cultural/tourism/occupation")
|
|
|
-public class OccupationInfoController {
|
|
|
+@RequestMapping("/category/occupation")
|
|
|
+public class CategoryOccupationController {
|
|
|
|
|
|
@Autowired
|
|
|
- private OccupationInfoService occupationInfoService;
|
|
|
+ private CategoryOccupationService categoryOccupationService;
|
|
|
|
|
|
@Autowired
|
|
|
private SequenceService sequenceService;
|
|
|
@@ -38,28 +38,28 @@ public class OccupationInfoController {
|
|
|
@Autowired
|
|
|
private OauthService oauthService;
|
|
|
|
|
|
- @Permission(value = "cultural.tourism.occupation.find", tags = "查询文旅岗位目录")
|
|
|
+ @Permission(value = "category.occupation.find", tags = "查询文旅岗位目录")
|
|
|
@PostMapping("/findPage")
|
|
|
- public Result findPage(@RequestBody QueryOccupationInfoParam param) {
|
|
|
+ public Result findPage(@RequestBody QueryCategoryOccupationParam param) {
|
|
|
|
|
|
- QueryWrapper<OccupationInfo> wrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<CategoryOccupation> wrapper = new QueryWrapper<>();
|
|
|
|
|
|
if (StringUtils.isNotBlank(param.getName())) {
|
|
|
wrapper.like("name", param.getName());
|
|
|
}
|
|
|
- Page<OccupationInfo> page = param.getPage();
|
|
|
+ Page<CategoryOccupation> page = param.getPage();
|
|
|
page.addOrder(OrderItem.desc("id"));
|
|
|
|
|
|
- Page<OccupationInfo> resultData = this.occupationInfoService.page(page, wrapper);
|
|
|
+ Page<CategoryOccupation> resultData = this.categoryOccupationService.page(page, wrapper);
|
|
|
|
|
|
return Result.instance(Result.Code.SUCCESS).setData(resultData);
|
|
|
}
|
|
|
|
|
|
- @Permission(value = "cultural.tourism.occupation.add", tags = "新建文旅岗位目录")
|
|
|
+ @Permission(value = "category.occupation.add", tags = "新建文旅岗位目录")
|
|
|
@PostMapping("/save")
|
|
|
- public Result save(@Valid @RequestBody SaveOccupationInfoParam param) throws Exception {
|
|
|
+ public Result save(@Valid @RequestBody SaveCategoryOccupationParam param) throws Exception {
|
|
|
|
|
|
- OccupationInfo entity = new OccupationInfo();
|
|
|
+ CategoryOccupation entity = new CategoryOccupation();
|
|
|
BeanUtils.copyProperties(param, entity);
|
|
|
|
|
|
OauthInfo oauthInfo = this.oauthService.getAuth(ServletContext.getAccessToken());
|
|
|
@@ -71,15 +71,15 @@ public class OccupationInfoController {
|
|
|
entity.setUpdatedBy(oauthInfo.getId());
|
|
|
entity.setId(this.sequenceService.nextId());
|
|
|
|
|
|
- this.occupationInfoService.save(entity);
|
|
|
+ this.categoryOccupationService.save(entity);
|
|
|
|
|
|
return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
}
|
|
|
|
|
|
- @Permission(value = "cultural.tourism.occupation.edit", tags = "更新文旅岗位目录")
|
|
|
+ @Permission(value = "category.occupation.edit", tags = "更新文旅岗位目录")
|
|
|
@PostMapping("/updateById")
|
|
|
- public Result updateById(Long id, @Valid @RequestBody SaveOccupationInfoParam param) {
|
|
|
- OccupationInfo entity = new OccupationInfo();
|
|
|
+ public Result updateById(Long id, @Valid @RequestBody SaveCategoryOccupationParam param) {
|
|
|
+ CategoryOccupation entity = new CategoryOccupation();
|
|
|
BeanUtils.copyProperties(param, entity);
|
|
|
|
|
|
OauthInfo oauthInfo = this.oauthService.getAuth(ServletContext.getAccessToken());
|
|
|
@@ -87,15 +87,15 @@ public class OccupationInfoController {
|
|
|
entity.setUpdatedTime(DateUtil.current());
|
|
|
entity.setId(id);
|
|
|
|
|
|
- this.occupationInfoService.updateById(entity);
|
|
|
+ this.categoryOccupationService.updateById(entity);
|
|
|
|
|
|
return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
}
|
|
|
|
|
|
- @Permission(value = "cultural.tourism.occupation.delete", tags = "删除文旅岗位目录")
|
|
|
+ @Permission(value = "category.occupation.delete", tags = "删除文旅岗位目录")
|
|
|
@PostMapping("/deleteByIds")
|
|
|
public Result deleteByIds(@RequestBody List<Long> ids) {
|
|
|
- this.occupationInfoService.removeByIds(ids);
|
|
|
+ this.categoryOccupationService.removeByIds(ids);
|
|
|
return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
}
|
|
|
}
|