|
@@ -1,14 +1,18 @@
|
|
|
package com.chelvc.cloud.maintain.controller;
|
|
|
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.MerchantDTO;
|
|
|
import com.chelvc.cloud.vehicle.api.param.HotMerchantModifyParam;
|
|
|
import com.chelvc.cloud.vehicle.api.service.HotMerchantService;
|
|
|
import com.chelvc.framework.base.annotation.ResponseWrapping;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import javax.validation.Valid;
|
|
|
+import javax.validation.constraints.Min;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 热门搜索接口
|
|
@@ -28,9 +32,9 @@ public class HotMerchantController {
|
|
|
*
|
|
|
* @param
|
|
|
*/
|
|
|
- @GetMapping("/hotMerchant/")
|
|
|
- public void addHotMerchant(@Valid HotMerchantModifyParam param) {
|
|
|
- this.hotMerchantService.addHotMerchant(param);
|
|
|
+ @GetMapping("/hotMerchant/{id}")
|
|
|
+ public void addHotMerchant(@PathVariable("id") @Min(value = 1, message = "商品ID不能小于1") Long id) {
|
|
|
+ this.hotMerchantService.addHotMerchant(id);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -40,8 +44,8 @@ public class HotMerchantController {
|
|
|
* @param
|
|
|
*/
|
|
|
@PostMapping("/listHotMerchant/")
|
|
|
- public void listHotMerchant() {
|
|
|
- this.hotMerchantService.listHotMerchant();
|
|
|
+ public List<MerchantDTO> listHotMerchant() {
|
|
|
+ return this.hotMerchantService.listHotMerchant();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -50,8 +54,8 @@ public class HotMerchantController {
|
|
|
* @param
|
|
|
*/
|
|
|
@PostMapping("/likeMerchant/")
|
|
|
- public void likeMerchant() {
|
|
|
- this.hotMerchantService.likeMerchant();
|
|
|
+ public List<MerchantDTO> likeMerchant() {
|
|
|
+ return this.hotMerchantService.likeMerchant();
|
|
|
}
|
|
|
|
|
|
|