1414
1515import com .tinyengine .it .common .base .Result ;
1616import com .tinyengine .it .common .log .SystemControllerLog ;
17- import com .tinyengine .it .model .entity .MaterialHistory ;
18- import com .tinyengine .it .service .material .MaterialHistoryService ;
17+ import com .tinyengine .it .model .entity .Material ;
18+ import com .tinyengine .it .service .material .MaterialService ;
1919import io .swagger .v3 .oas .annotations .Operation ;
2020import io .swagger .v3 .oas .annotations .Parameter ;
2121import io .swagger .v3 .oas .annotations .media .Content ;
3232import org .springframework .web .bind .annotation .RestController ;
3333
3434import javax .validation .Valid ;
35- import java .util .Arrays ;
3635import java .util .List ;
37- import java .util .Map ;
3836
3937/**
4038 * 物料历史api
4543@ RestController
4644@ RequestMapping ("/material-center/api" )
4745@ Tag (name = "物料历史" )
48- public class MaterialHistoryController {
46+ public class MaterialController {
4947 /**
50- * The MaterialHistory service.
48+ * The Material service.
5149 */
5250 @ Autowired
53- private MaterialHistoryService materialHistoryService ;
51+ private MaterialService materialService ;
5452
5553 /**
56- * 查询表MaterialHistory信息
54+ * 查询表Material信息
5755 *
58- * @return MaterialHistory信息 all materialHistory
56+ * @return Material信息 all material
5957 */
60- @ Operation (summary = "查询表MaterialHistory信息 " ,
61- description = "查询表MaterialHistory信息 " ,
58+ @ Operation (summary = "查询表Material信息 " ,
59+ description = "查询表Material信息 " ,
6260 responses = {
6361 @ ApiResponse (responseCode = "200" , description = "返回信息" ,
6462 content = @ Content (mediaType = "application/json" ,
65- schema = @ Schema (implementation = MaterialHistory .class ))),
63+ schema = @ Schema (implementation = Material .class ))),
6664 @ ApiResponse (responseCode = "400" , description = "请求失败" )})
67- @ SystemControllerLog (description = "查询表MaterialHistory信息 " )
68- @ GetMapping ("/material-history /list" )
69- public Result <List <MaterialHistory >> getAllMaterialHistory () {
70- List <MaterialHistory > materialHistoryList = materialHistoryService . findAllMaterialHistory ();
65+ @ SystemControllerLog (description = "查询表Material信息 " )
66+ @ GetMapping ("/material/list" )
67+ public Result <List <Material >> getAllMaterial () {
68+ List <Material > materialHistoryList = materialService . queryAllMaterial ();
7169 return Result .success (materialHistoryList );
7270 }
7371
7472 /**
75- * 创建MaterialHistory
73+ * 创建Material
7674 *
77- * @param materialHistory the materialHistory
78- * @return MaterialHistory信息 result
75+ * @param material the material
76+ * @return Material信息 result
7977 */
80- @ Operation (summary = "创建MaterialHistory " ,
81- description = "创建MaterialHistory " ,
78+ @ Operation (summary = "创建Material " ,
79+ description = "创建Material " ,
8280 parameters = {
83- @ Parameter (name = "MaterialHistory " , description = "MaterialHistory入参对象 " )
81+ @ Parameter (name = "Material " , description = "Material入参对象 " )
8482 },
8583 responses = {
8684 @ ApiResponse (responseCode = "200" , description = "返回信息" ,
8785 content = @ Content (mediaType = "application/json" ,
88- schema = @ Schema (implementation = MaterialHistory .class ))),
86+ schema = @ Schema (implementation = Material .class ))),
8987 @ ApiResponse (responseCode = "400" , description = "请求失败" )}
9088 )
91- @ SystemControllerLog (description = "创建MaterialHistory " )
92- @ PostMapping ("/material-history /create" )
93- public Result <MaterialHistory > createMaterialHistory (@ Valid @ RequestBody MaterialHistory materialHistory ) {
94- return materialHistoryService . createMaterialHistory ( materialHistory );
89+ @ SystemControllerLog (description = "创建Material " )
90+ @ PostMapping ("/material/create" )
91+ public Result <Material > createMaterial (@ Valid @ RequestBody Material material ) {
92+ return materialService . createMaterial ( material );
9593 }
9694
9795 /**
98- * 修改MaterialHistory信息
96+ * 修改Material信息
9997 *
10098 * @param id the id
101- * @param materialHistory the materialHistory
102- * @return MaterialHistory信息 result
99+ * @param material the material
100+ * @return Material信息 result
103101 */
104- @ Operation (summary = "修改单个MaterialHistory信息 " , description = "修改单个MaterialHistory信息 " , parameters = {
102+ @ Operation (summary = "修改单个Material信息 " , description = "修改单个Material信息 " , parameters = {
105103 @ Parameter (name = "id" , description = "appId" ),
106- @ Parameter (name = "MaterialHistory " , description = "入参对象" )}, responses = {
104+ @ Parameter (name = "Material " , description = "入参对象" )}, responses = {
107105 @ ApiResponse (responseCode = "200" , description = "返回信息" ,
108106 content = @ Content (mediaType = "application/json" ,
109- schema = @ Schema (implementation = MaterialHistory .class ))),
107+ schema = @ Schema (implementation = Material .class ))),
110108 @ ApiResponse (responseCode = "400" , description = "请求失败" )})
111- @ SystemControllerLog (description = "修改单个MaterialHistory信息 " )
112- @ PostMapping ("/apps /update/{id}" )
113- public Result <MaterialHistory > updateMaterialHistory (@ PathVariable Integer id , @ RequestBody MaterialHistory materialHistory ) {
114- materialHistory .setId (id );
115- return materialHistoryService . updateMaterialHistoryById ( materialHistory );
109+ @ SystemControllerLog (description = "修改单个Material信息 " )
110+ @ PostMapping ("/material /update/{id}" )
111+ public Result <Material > updateMaterial (@ PathVariable Integer id , @ RequestBody Material material ) {
112+ material .setId (id );
113+ return materialService . updateMaterialById ( material );
116114 }
117115
118116 /**
119- * 删除MaterialHistory信息
117+ * 删除Material信息
120118 *
121119 * @param id the id
122120 * @return app信息 result
123121 */
124122 @ Operation (summary = "删除app信息" ,
125123 description = "删除app信息" ,
126124 parameters = {
127- @ Parameter (name = "id" , description = "MaterialHistory主键id " )
125+ @ Parameter (name = "id" , description = "Material主键id " )
128126 },
129127 responses = {
130128 @ ApiResponse (responseCode = "200" , description = "返回信息" ,
131129 content = @ Content (mediaType = "application/json" ,
132- schema = @ Schema (implementation = MaterialHistory .class ))),
130+ schema = @ Schema (implementation = Material .class ))),
133131 @ ApiResponse (responseCode = "400" , description = "请求失败" )}
134132 )
135133 @ SystemControllerLog (description = "删除app信息" )
136- @ GetMapping ("/material-history /delete/{id}" )
137- public Result <MaterialHistory > deleteMaterialHistory (@ PathVariable Integer id ) {
138- return materialHistoryService . deleteMaterialHistoryById (id );
134+ @ GetMapping ("/material/delete/{id}" )
135+ public Result <Material > deleteMaterial (@ PathVariable Integer id ) {
136+ return materialService . deleteMaterialById (id );
139137 }
140138
141139 /**
@@ -148,11 +146,11 @@ public Result<MaterialHistory> deleteMaterialHistory(@PathVariable Integer id) {
148146 @ Parameter (name = "id" , description = "appId" )}, responses = {
149147 @ ApiResponse (responseCode = "200" , description = "返回信息" ,
150148 content = @ Content (mediaType = "application/json" ,
151- schema = @ Schema (implementation = MaterialHistory .class ))),
149+ schema = @ Schema (implementation = Material .class ))),
152150 @ ApiResponse (responseCode = "400" , description = "请求失败" )})
153151 @ SystemControllerLog (description = "获取应用信息详情" )
154- @ GetMapping ("/material-history /detail/{id}" )
155- public Result <MaterialHistory > detail (@ PathVariable Integer id ) {
156- return materialHistoryService . findMaterialHistoryById (id );
152+ @ GetMapping ("/material/detail/{id}" )
153+ public Result <Material > detail (@ PathVariable Integer id ) {
154+ return materialService . queryMaterialById (id );
157155 }
158156}
0 commit comments