zhitong.yu
2024-12-27 21e0b93688de2a98abe3b7b9c0cfed6efdc21183
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package com.hxzk.controller;
 
import com.github.pagehelper.PageInfo;
import com.hxzk.pojo.TbMessageHistory;
import com.hxzk.pojo.TbModel;
import com.hxzk.service.ModelService;
import com.hxzk.util.result;
import com.hxzk.util.resultutil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
 
@RestController
@RequestMapping("/")
public class ModelController {
    @Autowired
    ModelService modelServicel;
 
 
    @GetMapping("FindModelAll")
    public List<TbModel>FindModelAll(){
        return  modelServicel.FindModelAll();
    }
 
    @GetMapping("FindModelListAll")
    result<List<TbModel>> FindModelListAll(Integer page, Integer limit){
        PageInfo<TbModel> cz= modelServicel.findAll(page, limit);
        return resultutil.returnSuccess(cz.getTotal(), cz.getList());
    }
 
 
    @GetMapping("FindModelType")
    public List<TbModel>FindModelType(){
        return modelServicel.FindModelType();
    }
 
    @PostMapping("FindModelTypeList")
    public List<TbModel>FindModelTypeList(TbModel model){
        return modelServicel.FindModelTypeList(model);
    }
 
 
    @PostMapping("FindModelNameList")
    public TbModel FindModelNameList(TbModel model){
        return modelServicel.FindModelNameList(model);
    }
 
    @PostMapping("FindModelUrlList")
    public TbModel FindModelUrlList(TbModel model){
        return modelServicel.FindModelUrlList(model);
    }
 
 
 
    @PostMapping("addModel")
    public void addModel(TbModel model,HttpServletResponse response) throws IOException {
        modelServicel.addModel(model);
        response.sendRedirect("/hxzkuwb/HouTai/JiChu/model.jsp");
    }
 
 
    @PostMapping("upModel")
    public void upModel(TbModel model, HttpServletResponse response) throws IOException {
        if (model.getModelimg().equals("")){
            model.setModelimg(null);
        }
        if (model.getModelurl().equals("")){
            model.setModelurl(null);
        }
 
        response.sendRedirect("/hxzkuwb/HouTai/JiChu/model.jsp");
    }
 
    @PostMapping("deModel")
    public Integer deModel(TbModel model){
        return modelServicel.deModel(model);
    }
 
}