package com.ks.daylucky; import com.ks.daylucky.mapper.*; import com.ks.daylucky.pojo.DO.Announcement; import com.ks.daylucky.pojo.DO.UserMsg; import com.ks.daylucky.query.*; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import javax.annotation.Resource; @SpringBootTest public class MapperTest { @Resource private ActivityScanRecordMapper activityScanRecordMapper; @Resource private ActivityTagMapper activityTagMapper; @Resource private AnnouncementMapper announcementMapper; @Resource private AppConfigMapper appConfigMapper; @Resource private MsgTypeConfigMapper msgTypeConfigMapper; @Resource private UserInfoExtraMapper userInfoExtraMapper; @Resource private UserInfoMapper userInfoMapper; @Resource private UserMsgMapper userMsgMapper; @Test public void scanRecord() { ActivityScanQuery query = new ActivityScanQuery(); query.activityId = 1L; query.uid = 1L; query.count = 1; activityScanRecordMapper.list(query); activityScanRecordMapper.count(query); } @Test public void activityTag() { activityTagMapper.listByActivityId(1L); } @Test public void announcement() { AnnouncementQuery query = new AnnouncementQuery(); query.appId = 1L; query.key = "测试"; query.type = Announcement.AnnouncementType.home; query.count = 1; announcementMapper.list(query); announcementMapper.count(query); } @Test public void config() { AppConfigQuery query = new AppConfigQuery(); query.version = 10; query.minVersion = 1; query.key = "test"; query.appId = 1L; query.nameKey = "测试"; appConfigMapper.list(query); appConfigMapper.count(query); } @Test public void msgTypeConfig() { MsgTypeConfigQuery query = new MsgTypeConfigQuery(); query.msgType = UserMsg.UserMsgType.activity; query.appId = 1L; query.count = 1; msgTypeConfigMapper.list(query); msgTypeConfigMapper.count(query); } @Test public void userInfoExtra() { userInfoExtraMapper.selectByPrimaryKeyForUpdate(1L); } @Test public void userInfo() { UserInfoQuery query = new UserInfoQuery(); query.identifyCode = "123123"; query.appId = 1L; query.alipayUid = "123"; query.key = "123"; query.mobile = "1858318252"; query.wxOpenId = "wx123123123"; query.wxUnionId = "123123123123123"; userInfoMapper.list(query); userInfoMapper.count(query); } @Test public void userMsg() { UserMsgQuery query = new UserMsgQuery(); query.uid = 1L; query.msgType = UserMsg.UserMsgType.activity; userMsgMapper.list(query); userMsgMapper.count(query); } }