|
@@ -1,28 +1,54 @@
|
|
package cn.efunbox.audio.controller.hag;
|
|
package cn.efunbox.audio.controller.hag;
|
|
|
|
|
|
|
|
+import cn.efunbox.audio.service.hag.HagContentService;
|
|
import cn.efunbox.audio.service.hag.HagOrderService;
|
|
import cn.efunbox.audio.service.hag.HagOrderService;
|
|
|
|
+import cn.efunbox.audio.utils.BaseConstant;
|
|
import cn.efunbox.audio.vo.hag.HagSkillReq;
|
|
import cn.efunbox.audio.vo.hag.HagSkillReq;
|
|
import cn.efunbox.audio.vo.hag.HagSkillResp;
|
|
import cn.efunbox.audio.vo.hag.HagSkillResp;
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import java.util.Objects;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* HaOrderController
|
|
* HaOrderController
|
|
* Created by xusq on 2019/12/25.
|
|
* Created by xusq on 2019/12/25.
|
|
*/
|
|
*/
|
|
-@RequestMapping("/api/hag/v1/order")
|
|
|
|
|
|
+@Slf4j
|
|
|
|
+@RequestMapping("/api/hag/v1/auth")
|
|
@RestController
|
|
@RestController
|
|
public class HagOrderController {
|
|
public class HagOrderController {
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private HagOrderService hagOrderService;
|
|
private HagOrderService hagOrderService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private HagContentService hagContentService;
|
|
|
|
|
|
@PostMapping
|
|
@PostMapping
|
|
public HagSkillResp sync(@RequestBody HagSkillReq skillReq) {
|
|
public HagSkillResp sync(@RequestBody HagSkillReq skillReq) {
|
|
- return hagOrderService.save(skillReq);
|
|
|
|
|
|
+
|
|
|
|
+ log.info("HAG sync order param : {}", JSON.toJSONString(skillReq));
|
|
|
|
+ HagSkillResp hagSkillResp = new HagSkillResp();
|
|
|
|
+ HagSkillReq.HagHeader header = skillReq.getHeader();
|
|
|
|
+ if (Objects.isNull(header)) {
|
|
|
|
+ return hagSkillResp;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (Objects.equals(BaseConstant.HAG_SYNC_ORDER_TYPE,header.getType())) {
|
|
|
|
+ hagSkillResp = hagOrderService.save(skillReq);
|
|
|
|
+ } else {
|
|
|
|
+ hagSkillResp = hagContentService.getResUrl(skillReq);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return hagSkillResp;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|