You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
2.1 KiB
56 lines
2.1 KiB
package com.community.pocket.api.android;
|
|
|
|
import com.community.pocket.entity.po.android.GarbageWasteManage;
|
|
import com.community.pocket.entity.po.android.GarbageWastePrice;
|
|
import com.community.pocket.entity.vo.Result;
|
|
import com.community.pocket.entity.vo.android.*;
|
|
import com.community.pocket.repository.android.GarbageDao;
|
|
import com.community.pocket.repository.android.GarbagePriceDao;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 垃圾分类接口
|
|
*/
|
|
@RestController
|
|
public class GarbageController {
|
|
|
|
@Autowired
|
|
private GarbageDao garbageDao;
|
|
|
|
@Autowired
|
|
private GarbagePriceDao garbagePriceDao;
|
|
|
|
//检索垃圾
|
|
@GetMapping("/garbage/sorting")
|
|
public GarbageSortingResponse search(QueryGarbageForm garbageForm) {
|
|
List<GarbageVo> garbageVoList = garbageDao.query(garbageForm);
|
|
GarbageSortingResponse response = new GarbageSortingResponse(Result.OK, GarbageSortingResponse.Msg.ok);
|
|
response.setGarbageSortings(garbageVoList);
|
|
return response;
|
|
}
|
|
|
|
//检索默认废品信息
|
|
@GetMapping("/garbage/waste")
|
|
public GarbageWasteResponse searchDefault() {
|
|
GarbageWasteResponse response = new GarbageWasteResponse(Result.OK, GarbageWasteResponse.Msg.ok);
|
|
List<GarbageWastePrice> garbageWastePrices = garbagePriceDao.query("");
|
|
GarbageWasteManage manage = garbagePriceDao.queryManager();
|
|
response.setDefaultList(garbageWastePrices);
|
|
response.setGarbageWasteManage(manage);
|
|
return response;
|
|
}
|
|
|
|
//检索废品
|
|
@GetMapping("/garbage/waste/query")
|
|
public GarbageWasteResponse search(QueryWasteForm queryWasteForm) {
|
|
GarbageWasteResponse response = new GarbageWasteResponse(Result.OK, GarbageWasteResponse.Msg.ok);
|
|
List<GarbageWastePrice> garbageWastePrices = garbagePriceDao.query(queryWasteForm.getName());
|
|
response.setSearchList(garbageWastePrices);
|
|
return response;
|
|
}
|
|
|
|
}
|
|
|