package com.thhy.pm.modules.biz.draw.controller;
|
|
import com.github.pagehelper.PageInfo;
|
import com.thhy.general.common.BasicResult;
|
import com.thhy.general.utils.PagingUtils;
|
import com.thhy.pm.modules.biz.draw.entity.DrawType;
|
import com.thhy.pm.modules.biz.draw.service.DrawTypeService;
|
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-25 09:38:38
|
*/
|
@RestController
|
@RequestMapping("drawType")
|
public class DrawTypeController {
|
|
|
@Autowired
|
private DrawTypeService drawTypeService;
|
|
@RequestMapping("findList")
|
public BasicResult findList(@RequestBody(required = false) DrawType drawType,HttpServletRequest req){
|
PagingUtils.setPageParam(req);
|
List<DrawType> drawTypeList = drawTypeService.findList(drawType);
|
PageInfo<DrawType> pageInfo = new PageInfo<>(drawTypeList);
|
return BasicResult.success(pageInfo);
|
}
|
|
@RequestMapping("addDrawType")
|
public BasicResult addDrawType(@RequestBody DrawType drawType){
|
drawTypeService.addDrawType(drawType);
|
return BasicResult.success();
|
}
|
|
/**
|
@RequestMapping("update")
|
public BasicResult update(@RequestBody DrawType drawType){
|
drawTypeService.update(drawType);
|
return BasicResult.success();
|
}**/
|
|
@RequestMapping("delete")
|
public BasicResult delete(@RequestBody DrawType drawType){
|
drawTypeService.delete(drawType.getDrawTypeId());
|
return BasicResult.success();
|
}
|
}
|