package cn.axzo.msg.center.dal;

import cn.axzo.msg.center.MsgCenterApplication;
import cn.axzo.msg.center.domain.entity.TodoBusiness;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Commit;

/**
 * @author yanglin
 */
@SpringBootTest(classes = MsgCenterApplication.class)
@RequiredArgsConstructor(onConstructor_ = @Autowired)
class TodoBusinessDaoTest {

    private final TodoBusinessDao todoBusinessDao;

    @Test @Commit
    void foo() {
        JSONObject bizExtParam = JSON.parseObject("{\"taskName\": \"万科1号楼 20层 2单元\"}");
        bizExtParam.put("1", "1");
        bizExtParam.put("2", "1");
        todoBusinessDao.lambdaUpdate()
                .eq(TodoBusiness::getId, 110944L)
                .set(TodoBusiness::getBizExtParam, bizExtParam)
                .update();
    }

}