|
@@ -0,0 +1,113 @@
|
|
|
+package edu.travel.country.web;
|
|
|
+
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import edu.travel.country.entity.ShopCurrency;
|
|
|
+import edu.travel.country.service.ShopCurrencyService;
|
|
|
+import edu.travel.dto.ShopCurrencyDto;
|
|
|
+import edu.travel.remote.ShopCurrencyRemoteController;
|
|
|
+import edu.travel.rpc.RPCBaseResponse;
|
|
|
+import edu.travel.vo.ShopCurrencyVo;
|
|
|
+import edu.travel.web.BaseController;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+
|
|
|
+* 货币表(shop_currency)表控制层
|
|
|
+*
|
|
|
+* @author xxxxx
|
|
|
+*/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/shop_currency")
|
|
|
+public class ShopCurrencyController extends BaseController<ShopCurrency> implements ShopCurrencyRemoteController {
|
|
|
+
|
|
|
+* 服务对象
|
|
|
+*/
|
|
|
+ @Autowired
|
|
|
+ private ShopCurrencyService shopCurrencyService;
|
|
|
+
|
|
|
+ * 分页
|
|
|
+ */
|
|
|
+
|
|
|
+ @GetMapping("/getCurrencyPage")
|
|
|
+ public RPCBaseResponse<IPage<ShopCurrencyVo>> getCurrencyPage(ShopCurrencyDto dto) {
|
|
|
+ return shopCurrencyService.getCurrencyPage(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ * 获取货币信息
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @GetMapping("/getCurrencyFormId")
|
|
|
+ public RPCBaseResponse<ShopCurrencyVo> getFormId(String id) {
|
|
|
+ RPCBaseResponse<ShopCurrency> shopCurrencyRPCBaseResponse = super.getId(id);
|
|
|
+ RPCBaseResponse<ShopCurrencyVo> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(shopCurrencyRPCBaseResponse, shopCurrencyVoRPCBaseResponse);
|
|
|
+ return shopCurrencyVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 更新货币信息
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @PostMapping("/updateCurrencyFormId")
|
|
|
+ public RPCBaseResponse<ShopCurrencyVo> updateTargetFormId(ShopCurrencyDto entity) {
|
|
|
+ ShopCurrency shopCurrency = new ShopCurrency();
|
|
|
+ BeanUtils.copyProperties(entity, shopCurrency);
|
|
|
+ RPCBaseResponse<ShopCurrency> shopCurrencyRPCBaseResponse = super.updateTargetById(shopCurrency);
|
|
|
+ RPCBaseResponse<ShopCurrencyVo> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(shopCurrencyRPCBaseResponse, shopCurrencyVoRPCBaseResponse);
|
|
|
+ return shopCurrencyVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 新增货币信息
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @PostMapping("/saveCurrencyForm")
|
|
|
+ public RPCBaseResponse<ShopCurrencyVo> saveFormTarget(ShopCurrencyDto entity) {
|
|
|
+ ShopCurrency shopCurrency = new ShopCurrency();
|
|
|
+ BeanUtils.copyProperties(entity, shopCurrency);
|
|
|
+ RPCBaseResponse<ShopCurrency> shopCurrencyRPCBaseResponse = super.saveTarget(shopCurrency);
|
|
|
+ RPCBaseResponse<ShopCurrencyVo> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(shopCurrencyRPCBaseResponse, shopCurrencyVoRPCBaseResponse);
|
|
|
+ return shopCurrencyVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 删除货币信息
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @PostMapping("/deleteCurrencyFormId")
|
|
|
+ public RPCBaseResponse<ShopCurrencyVo> deleteTargetFormId(List<String> ids) {
|
|
|
+ RPCBaseResponse<ShopCurrency> shopCurrencyRPCBaseResponse = super.deleteTargetById(ids);
|
|
|
+ RPCBaseResponse<ShopCurrencyVo> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(shopCurrencyRPCBaseResponse, shopCurrencyVoRPCBaseResponse);
|
|
|
+ return shopCurrencyVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 获取所有货币信息
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @GetMapping("/listCurrencyForm")
|
|
|
+ public RPCBaseResponse<List<ShopCurrencyVo>> getAllForm() {
|
|
|
+ RPCBaseResponse<List<ShopCurrency>> listRPCBaseResponse = super.listAll();
|
|
|
+ RPCBaseResponse<List<ShopCurrencyVo>> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(listRPCBaseResponse, shopCurrencyVoRPCBaseResponse);
|
|
|
+ return shopCurrencyVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+}
|