CfMaterialTextAttrControl.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package cn.hmsoft.mr.control.cf;
  2. import cn.hmsoft.helper.StringHelper;
  3. import cn.hmsoft.application.web.Ajax;
  4. import cn.hmsoft.frame.control.FrameControl;
  5. import cn.hmsoft.mr.data.model.cf.CfMaterialTextAttr;
  6. import cn.hmsoft.mr.service.cf.CfMaterialTextAttrService;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RestController;
  10. /**
  11. * 控制器.
  12. *
  13. * @author: shudonghui
  14. * @date: 2023-05-23 09:24:51
  15. * @version: 1.0
  16. * @email: shudonghui@qmth.com.cn
  17. * @Company: www.hmsoft.cn
  18. */
  19. @RestController
  20. public class CfMaterialTextAttrControl extends FrameControl {
  21. @Autowired
  22. private CfMaterialTextAttrService cfMaterialTextAttrService;
  23. @RequestMapping("cf/material/textattr/page")
  24. public Ajax page(Integer material_def_id,String query, Integer limit, Integer start, String order, String type) {
  25. if (StringHelper.isEmpty(order)) {
  26. //TODO 修改为排序字段
  27. order = "1";
  28. }
  29. return new Ajax(this.cfMaterialTextAttrService.page(material_def_id,query, start, limit, this.getQueryOrder(order, type)));
  30. }
  31. @RequestMapping("cf/material/textattr/add")
  32. public Ajax add(CfMaterialTextAttr cfMaterialTextAttr) {
  33. return this.cfMaterialTextAttrService.add(cfMaterialTextAttr);
  34. }
  35. @RequestMapping("cf/material/textattr/edit")
  36. public Ajax edit(CfMaterialTextAttr cfMaterialTextAttr) {
  37. return this.cfMaterialTextAttrService.edit(cfMaterialTextAttr);
  38. }
  39. @RequestMapping("cf/material/textattr/delete")
  40. public Ajax delete(Integer attr_id) {
  41. return this.cfMaterialTextAttrService.delete(attr_id);
  42. }
  43. @RequestMapping("cf/material/textattr/get")
  44. public Ajax get(Integer id) {
  45. return new Ajax(this.cfMaterialTextAttrService.get(id));
  46. }
  47. }