package com.thhy.staff.modules.biz.duty.controller;
|
|
import com.github.pagehelper.PageInfo;
|
import com.thhy.general.common.BasicResult;
|
import com.thhy.general.utils.PagingUtils;
|
import com.thhy.staff.modules.biz.duty.entity.Duty;
|
import com.thhy.staff.modules.biz.duty.entity.DutyListVo;
|
import com.thhy.staff.modules.biz.duty.service.DutyService;
|
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.List;
|
|
/**
|
* @author zhang_xiao_bo
|
* @since 2023-04-06 09:30:38
|
*/
|
@RestController
|
@RequestMapping("duty")
|
public class DutyController {
|
|
|
@Autowired
|
private DutyService dutyService;
|
|
@RequestMapping("findList")
|
public BasicResult findList(@RequestBody(required = false) Duty duty,HttpServletRequest req){
|
PagingUtils.setPageParam(req);
|
List<DutyListVo> dutyList = dutyService.findList(duty);
|
PageInfo<DutyListVo> pageInfo = new PageInfo<>(dutyList);
|
return BasicResult.success(pageInfo);
|
}
|
|
@RequestMapping("addDuty")
|
public BasicResult addDuty(@RequestBody Duty duty){
|
dutyService.addDuty(duty);
|
return BasicResult.success();
|
}
|
|
/**
|
@RequestMapping("update")
|
public BasicResult update(@RequestBody Duty duty){
|
dutyService.update(duty);
|
return BasicResult.success();
|
}**/
|
|
@RequestMapping("delete")
|
public BasicResult delete(@RequestBody Duty duty){
|
dutyService.delete(duty.getDutyId());
|
return BasicResult.success();
|
}
|
}
|