New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.sanshuo.ComEventArchiveVO; |
| | | import com.panzhihua.common.model.vos.sanshuo.ComEventConciliationVO; |
| | | import com.panzhihua.common.model.vos.sanshuo.ComEventDetailVO; |
| | | import com.panzhihua.common.model.vos.sanshuo.ComEventRequestImageVO; |
| | | import com.panzhihua.service_community.ServiceCommunityApplication; |
| | | import com.panzhihua.service_community.entity.ComEvent; |
| | | import com.panzhihua.service_community.service.IComEventService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | import static org.junit.jupiter.api.Assertions.*; |
| | | |
| | | /** |
| | | * 应用模块名称<p> |
| | | * 代码描述<p> |
| | | * Copyright: Copyright (C) 2022 XXX, Inc. All rights reserved. <p> |
| | | * Company: 成都呐喊信息技术有限公司<p> |
| | | * |
| | | * @author manailin |
| | | * @since 2022/9/13 16:27 |
| | | */ |
| | | @Slf4j |
| | | @SpringBootTest(classes = ServiceCommunityApplication.class) |
| | | class ComEventServiceImplTest { |
| | | |
| | | @Resource |
| | | private IComEventService comEventService; |
| | | |
| | | @Test |
| | | void pageByComEvent() { |
| | | Page pagination = new Page(1, 10); |
| | | ComEvent comEvent=new ComEvent(); |
| | | // comEvent.setCreateBy(1l); |
| | | comEvent.setKeyword("17345059081"); |
| | | R data = comEventService.pageByComEvent(comEvent, pagination); |
| | | log.info(JSONObject.toJSONString(data)); |
| | | } |
| | | |
| | | @Test |
| | | void listByComEvent() { |
| | | } |
| | | |
| | | @Test |
| | | void insertComEvent() { |
| | | ComEvent comEvent =new ComEvent(); |
| | | comEvent.setRequestUserId(1l); |
| | | comEvent.setRequestUserEventDes("测试申请数据"); |
| | | comEvent.setType("2"); |
| | | comEvent.setEventCategory(1l); |
| | | comEvent.setSpecialistId(1L); |
| | | comEvent.setAppointmentTime(new Date()); |
| | | List<ComEventRequestImageVO> images =new ArrayList<>(); |
| | | ComEventRequestImageVO comEventRequestImageVO =new ComEventRequestImageVO(); |
| | | comEventRequestImageVO.setUrl("www.baidu.com"); |
| | | images.add(comEventRequestImageVO); |
| | | comEvent.setImages(images); |
| | | comEventService.insertComEvent(comEvent); |
| | | } |
| | | |
| | | @Test |
| | | void updateComEvent() { |
| | | } |
| | | |
| | | @Test |
| | | void updateEnabled() { |
| | | } |
| | | |
| | | @Test |
| | | void conciliationEvent() { |
| | | } |
| | | |
| | | @Test |
| | | void cancelRequest() { |
| | | comEventService.cancelRequest(1569688381582086144L); |
| | | } |
| | | |
| | | @Test |
| | | void detail() { |
| | | HashMap data = comEventService.detail("1569688381582086144"); |
| | | log.info(JSONObject.toJSONString(data)); |
| | | } |
| | | |
| | | @Test |
| | | void calculate() { |
| | | R data = comEventService.calculate(); |
| | | log.info(JSONObject.toJSONString(data)); |
| | | } |
| | | |
| | | @Test |
| | | void archiveRequest() { |
| | | ComEventArchiveVO comEventArchiveVO =new ComEventArchiveVO(); |
| | | comEventArchiveVO.setId(1L); |
| | | comEventArchiveVO.setResult("测试数据"); |
| | | comEventArchiveVO.setImages(null); |
| | | LoginUserInfoVO sysUser =new LoginUserInfoVO(); |
| | | sysUser.setUserId(1L); |
| | | R data = comEventService.archiveRequest(comEventArchiveVO,sysUser); |
| | | log.info(JSONObject.toJSONString(data)); |
| | | } |
| | | } |