31 lines
936 B
Java
31 lines
936 B
Java
|
package com.bigdata.wxappserver.service;
|
||
|
|
||
|
import com.alibaba.fastjson.JSON;
|
||
|
import com.alibaba.fastjson.JSONObject;
|
||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||
|
import com.bigdata.wxappserver.entity.Order;
|
||
|
import com.bigdata.wxappserver.mapper.OrderMapper;
|
||
|
import org.springframework.stereotype.Service;
|
||
|
|
||
|
/**
|
||
|
* Created with IntelliJ IDEA.
|
||
|
*
|
||
|
* @Author: Cool
|
||
|
* @Date: 2024/08/28/20:28
|
||
|
* @Description:
|
||
|
*/
|
||
|
@Service
|
||
|
public class OrderService extends ServiceImpl<OrderMapper, Order> {
|
||
|
|
||
|
|
||
|
public JSONObject addOrUpdate(JSONObject jsonObject) {
|
||
|
Order order = jsonObject.toJavaObject(Order.class);
|
||
|
if (order==null){
|
||
|
return new JSONObject().fluentPut("success",false).fluentPut("message","参数错误");
|
||
|
}
|
||
|
// TODO 判空
|
||
|
boolean success = saveOrUpdate(order);
|
||
|
return new JSONObject().fluentPut("message","success").fluentPut("success",success);
|
||
|
}
|
||
|
}
|