EKP接口开发Webservice服务和Restservice服务以及定时任务Demo

  • 继承com.landray.kmss.sys.webservice2.interfaces.ISysWebservice,同时在接口上使用@WebService注解将其标识为WebService接口
package com.landray.kmss.third.notify.webservice;import com.alibaba.fastjson.JSONObject;
import com.landray.kmss.sys.webservice2.interfaces.ISysWebservice;import javax.jws.WebService;/*** 外部系统消息通知服务接口*/
@WebService
public interface IThirdNotifyWebService extends ISysWebservice {/*外部系统消息通知服务接口*/JSONObject sendToNotifyInfo(JSONObject jsonObject) throws Exception;
}
  • 编写服务实现类
package com.landray.kmss.third.notify.webservice.impl;import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.landray.kmss.common.service.IBaseService;
import com.landray.kmss.constant.SysNotifyConstant;
import com.landray.kmss.hr.staff.model.HrStaffPersonInfo;
import com.landray.kmss.hr.staff.service.IHrStaffPersonInfoService;
import com.landray.kmss.sys.metadata.interfaces.ExtendDataServiceImp;
import com.landray.kmss.sys.notify.constant.SysNotifyConstants;
import com.landray.kmss.sys.notify.interfaces.ISysNotifyMainCoreService;
import com.landray.kmss.sys.notify.interfaces.NotifyContext;
import com.landray.kmss.third.notify.model.ThirdNotifyInfoDetails;
import com.landray.kmss.third.notify.service.IThirdNotifyInfoDetailsService;
import com.landray.kmss.third.notify.webservice.IThirdNotifyWebService;
import com.landray.kmss.web.annotation.RestApi;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;import static com.landray.kmss.third.notify.webservice.ThirdNotifyConstant.*;
import static com.landray.kmss.util.SpringBeanUtil.getBean;/*** 外部系统消息通知服务接口*/
@Controller
@RequestMapping(value = "/api/third-notify/thirdNotifyWebService", method = RequestMethod.POST)
@RestApi(docUrl = "/third/notify/webservice/third_notify_service_help.jsp", name = "thirdNotifyWebServiceImp", resourceKey = "third-notify:module.third.notify")
public class ThirdNotifyWebServiceImpl extends ExtendDataServiceImp implements IThirdNotifyWebService {/*注入外部系统消息通知信息表信息*/private IThirdNotifyInfoDetailsService thirdNotifyInfoDetailsService;public IBaseService getServiceImp() {if (thirdNotifyInfoDetailsService == null) {thirdNotifyInfoDetailsService = (IThirdNotifyInfoDetailsService) getBean("thirdNotifyInfoDetailsService");}return thirdNotifyInfoDetailsService;}/*注入消息通知*/private ISysNotifyMainCoreService sysNotifyMainCoreService;public ISysNotifyMainCoreService getSysNotifyMainCoreServiceImp() {if (sysNotifyMainCoreService == null) {sysNotifyMainCoreService = (ISysNotifyMainCoreService) getBean("sysNotifyMainCoreService");}return sysNotifyMainCoreService;}/*注入人员组织架构*/private IHrStaffPersonInfoService hrStaffPersonInfoService;public IHrStaffPersonInfoService getHrStaffPersonInfoServiceImp() {if (hrStaffPersonInfoService == null) {hrStaffPersonInfoService = (IHrStaffPersonInfoService) getBean("hrStaffPersonInfoService");}return hrStaffPersonInfoService;}/*** @param jsonObject* @return com.alibaba.fastjson.JSONObject* @description: 外部系统消息通知服务接口* @author: 王雄峰* @date: 2023/10/16*/@Override@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)@ResponseBody@RequestMapping(value = "/sendToNotifyInfo", method = RequestMethod.POST)public JSONObject sendToNotifyInfo(@RequestBody JSONObject jsonObject) throws Exception {//声明最后返回消息变量JSONObject resultJson = new JSONObject();//声明返回消息的数组类型JSONArray resultJsonArr = new JSONArray();//数据校验是否有误boolean isError = false;//格式化日期SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");try {//判断JSON参数是否为空if (jsonObject != null && !jsonObject.isEmpty() && jsonObject.size() != 0) {//判断JSON是否包含规定的keyif (jsonObject.containsKey("sendToNotifyInfo")) {//获取规定的key值,得到JSON数组JSONArray jsonArray = jsonObject.getJSONArray("sendToNotifyInfo");// 数组不为空,则进行遍历,获取每一项的值if (jsonArray.size() != 0 && !jsonArray.isEmpty()) {//保存数据modelThirdNotifyInfoDetails thirdNotifyInfoDetails = new ThirdNotifyInfoDetails();JSONObject jsonItem;//每一个json数据对象变量String notifySubject;//消息主题String notifyContent;//消息内容String notifySenderNo;//发送给对应人员的编号String notifyPush;//消息推送类型,即时或者是定时String notifyType;//消息推送通知方式,钉钉或者邮件通知等等String notifySendTime;//定时消息通知发送时间for (int i = 0; i < jsonArray.size(); i++) {//重置数据校验标识isError = false;jsonItem = jsonArray.getJSONObject(i);if (jsonItem != null && !jsonItem.isEmpty()) {//消息通知主题notifySubject = jsonItem.get("notifySubject").toString();thirdNotifyInfoDetails.setNotifySubject(notifySubject);//消息通知内容notifyContent = jsonItem.get("notifyContent").toString();thirdNotifyInfoDetails.setNotifyContent(notifyContent);//消息通知发送人编号notifySenderNo = jsonItem.get("notifySenderNo").toString();if ("".equals(notifySenderNo) || notifySenderNo == "") {JSONObject resultNoJson = new JSONObject();resultNoJson.put(RETURNSTATE, ERROR);resultNoJson.put(RETURNMESSAGE, "[notifySenderNo]" + MESSAGENOTIFYSENDERNO);resultJsonArr.add(resultNoJson);isError = true;} else {thirdNotifyInfoDetails.setNotifySenderNo(notifySenderNo);}//消息通知发送人姓名thirdNotifyInfoDetails.setNotifySenderName(jsonItem.get("notifySenderName").toString());//消息通知发送时间notifySendTime = jsonItem.get("notifySendTime").toString();//时间不为空,则校验格式if (!"".equals(notifySendTime) && notifySendTime != "") {try {thirdNotifyInfoDetails.setNotifySendTime(dateFormat.parse(notifySendTime));} catch (Exception e) {JSONObject resultTimeJson = new JSONObject();resultTimeJson.put(RETURNSTATE, ERROR);resultTimeJson.put(RETURNMESSAGE, "编号:[" + notifySenderNo + "]" + MESSAGENOTIFYTIME);resultJsonArr.add(resultTimeJson);isError = true;}} else {thirdNotifyInfoDetails.setNotifySendTime(null);}//消息通知系统来源(调用系统来源:lims系统、报告系统)thirdNotifyInfoDetails.setNotifySource(jsonItem.get("notifySource").toString());//消息通知推送类型(即时推送-1;定时推送-2;)notifyPush = jsonItem.get("notifyPush").toString();if (NOW.equals(notifyPush) || TIMED.equals(notifyPush)) {thirdNotifyInfoDetails.setNotifyPush(notifyPush);} else {JSONObject resultPushJson = new JSONObject();resultPushJson.put(RETURNSTATE, ERROR);resultPushJson.put(RETURNMESSAGE, "编号:[" + notifySenderNo + "]" + MESSAGENOTIFYPUSH);resultJsonArr.add(resultPushJson);isError = true;}//消息通知推送方式(以哪一种通知类型进行通知:钉钉类型-1;邮件类型-2;)notifyType = jsonItem.get("notifyType").toString();if (DINGTALK.equals(notifyType) || EMAIL.equals(notifyType)) {thirdNotifyInfoDetails.setNotifyType(notifyType);} else {JSONObject resultTypeJson = new JSONObject();resultTypeJson.put(RETURNSTATE, ERROR);resultTypeJson.put(RETURNMESSAGE, "编号:[" + notifySenderNo + "]" + MESSAGENOTIFYTYPE);resultJsonArr.add(resultTypeJson);isError = true;}//消息通知接收人编号thirdNotifyInfoDetails.setNotifyRecipientNo(jsonItem.get("notifyRecipientNo").toString());//消息通知接收人姓名thirdNotifyInfoDetails.setNotifyRecipientName(jsonItem.get("notifyRecipientName").toString());//消息通知创建时间(当前时间)thirdNotifyInfoDetails.setNotifyCreateTime(new Date());//消息通知更新时间(当前时间)thirdNotifyInfoDetails.setNotifyUpdateTime(new Date());//消息通知推送类型(即时推送-1;定时推送-2;)即时推送则调用推送方法,定时则保存数据,等待定时任务进行推送if (NOW.equals(notifyPush) && DINGTALK.equals(notifyType) && !isError) {try {//即时发送JSONObject sendResult = this.sendTodoFromResource(notifySenderNo, notifySubject, notifyContent);if (SUCCES.equals(sendResult.getString(RETURNSTATE))) {//消息通知推送标识(未完成-0;已完成-1)thirdNotifyInfoDetails.setNotifyIsFlag("1");//发送成功保存数据getServiceImp().add(thirdNotifyInfoDetails);} else {JSONObject getSendState = new JSONObject();getSendState.put(RETURNSTATE, sendResult.getString(RETURNSTATE));getSendState.put(RETURNMESSAGE, "编号:[" + notifySenderNo + "]" + sendResult.getString(RETURNMESSAGE));resultJsonArr.add(getSendState);isError = true;}} catch (Exception e) {//声明存放异常的JSON变量JSONObject errorJson = new JSONObject();errorJson.put(RETURNSTATE, ERROR);errorJson.put(RETURNMESSAGE, "编号:[" + notifySenderNo + "]" + MESSAGESEND2);resultJsonArr.add(errorJson);isError = true;e.printStackTrace();}} else if (TIMED.equals(notifyPush) && !isError) {//定时推送//消息通知推送标识(未完成-0;已完成-1)thirdNotifyInfoDetails.setNotifyIsFlag("0");getServiceImp().add(thirdNotifyInfoDetails);}}}} else {//放入返回请求信息resultJson.put(RETURNSTATE, ERROR);resultJson.put(RETURNMESSAGE, MESSAGE4);return resultJson;}} else {//放入返回请求信息resultJson.put(RETURNSTATE, ERROR);resultJson.put(RETURNMESSAGE, MESSAGE3);return resultJson;}} else {//放入返回请求信息resultJson.put(RETURNSTATE, ERROR);resultJson.put(RETURNMESSAGE, MESSAGE2);return resultJson;}} catch (Exception e) {//放入返回请求信息resultJson.put(RETURNSTATE, ERROR);resultJson.put(RETURNMESSAGE, MESSAGE1);e.printStackTrace();return resultJson;}if (isError) {resultJson.put(RETURNSTATE, ERROR);resultJson.put(RETURNMESSAGE, resultJsonArr);} else {resultJson.put(RETURNSTATE, SUCCES);resultJson.put(RETURNMESSAGE, MESSAGESUCCES);}return resultJson;}/*** @param notifySenderNo* @param notifySubject* @param notifyContent* @return com.alibaba.fastjson.JSONObject* @description: 根据传递的人员编号给对应的人员OA和钉钉发送通知* @author: 王雄峰* @date: 2023/10/16*/public JSONObject sendTodoFromResource(String notifySenderNo, String notifySubject, String notifyContent) {//声明返回消息变量JSONObject sendResultJson = new JSONObject();//默认调用成功sendResultJson.put(RETURNSTATE, SUCCES);sendResultJson.put(RETURNMESSAGE, MESSAGESEND1);try {//根据工号查询员工信息HrStaffPersonInfo senderInfo = getHrStaffPersonInfoServiceImp().findPersonInfoByStaffNo(notifySenderNo);if (senderInfo == null) {//查询不到对应编号的员工信息,调用失败sendResultJson.put(RETURNSTATE, ERROR);sendResultJson.put(RETURNMESSAGE, MESSAGESEND3);return sendResultJson;}//获取上下文NotifyContext notifyContext = getSysNotifyMainCoreServiceImp().getContext(null);//获取通知方式notifyContext.setNotifyType("todo");// 设置发布类型为“待办”(默认为待阅)//“待办”消息发送出去后,需要到某事件发生后才变成已办,如审批通过等notifyContext.setFlag(SysNotifyConstant.NOTIFY_TODOTYPE_ONCE);// 设置发布KEY值,为后面的删除准备notifyContext.setKey("thirdNotifyInfo");//获取通知人List targets = new ArrayList();targets.add(senderInfo.getFdOrgPerson());//设置发布通知人notifyContext.setNotifyTarget(targets);notifyContext.setLink("");notifyContext.setSubject(notifySubject);notifyContext.setContent(notifyContent);notifyContext.setParameter1(SysNotifyConstants.SUPPORT_MORETIMES_SEND_TODO);getSysNotifyMainCoreServiceImp().sendNotify(senderInfo, notifyContext, null);} catch (Exception e) {e.printStackTrace();sendResultJson.put(RETURNSTATE, ERROR);sendResultJson.put(RETURNMESSAGE, MESSAGESEND2);return sendResultJson;}return sendResultJson;}
}
  • 添加spring bean配置
<!--外部系统消息通知WebService服务接口-->
<bean id="thirdNotifyWebService" class="com.landray.kmss.third.notify.webservice.impl.ThirdNotifyWebServiceImpl"/>
  • 在功能模块中添加WebService的扩展配置,实现Web服务的扩展点
    <!--外部系统消息通知WebService服务接口-开始--><extensionpoint="com.landray.kmss.sys.webservice2"><itemname="registry"><paramname="serviceName"value="外部系统消息通知"/><paramname="serviceClass"value="com.landray.kmss.third.notify.webservice.IThirdNotifyWebService"/><paramname="serviceBean"value="thirdNotifyWebService"/><paramname="serviceDoc"value="/third/notify/webservice/third_notify_service_help.jsp"/></item></extension><!--外部系统消息通知WebService服务接口-结束-->
  • 导入并发布服务
    在这里插入图片描述
定时任务
  • 添加一个接口
package com.landray.kmss.third.notify.webservice;import com.landray.kmss.common.service.IBaseService;/*** 外部系统消息通知定时任务服务接口*/
public interface IThirdNotifyJobWebService extends IBaseService {/*外部系统消息通知定时任务服务接口*/void sendToNotifyInfoJob() throws Exception;
}
  • 添加一个服务类,实现接口,实现接口中的方法
package com.landray.kmss.third.notify.webservice.impl;import com.alibaba.fastjson.JSONObject;
import com.landray.kmss.common.service.BaseServiceImp;
import com.landray.kmss.common.service.IBaseService;
import com.landray.kmss.third.notify.model.ThirdNotifyInfoDetails;
import com.landray.kmss.third.notify.service.IThirdNotifyInfoDetailsService;
import com.landray.kmss.third.notify.webservice.IThirdNotifyJobWebService;
import com.landray.kmss.util.SpringBeanUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;import java.util.Date;
import java.util.List;import static com.landray.kmss.third.notify.webservice.ThirdNotifyConstant.*;
import static com.landray.kmss.util.SpringBeanUtil.getBean;/*** 外部系统消息通知定时任务服务接口*/
public class ThirdNotifyJobWebServiceImpl extends BaseServiceImp implements IThirdNotifyJobWebService {private static final Log logger = LogFactory.getLog(ThirdNotifyJobWebServiceImpl.class);/*注入外部系统消息通知信息表信息*/private IThirdNotifyInfoDetailsService thirdNotifyInfoDetailsService;public IBaseService getServiceImp() {if (thirdNotifyInfoDetailsService == null) {thirdNotifyInfoDetailsService = (IThirdNotifyInfoDetailsService) getBean("thirdNotifyInfoDetailsService");}return thirdNotifyInfoDetailsService;}private IThirdNotifyInfoDetailsService getThirdNotifyInfoDetailsService() {if (thirdNotifyInfoDetailsService == null)thirdNotifyInfoDetailsService = (IThirdNotifyInfoDetailsService) SpringBeanUtil.getBean("thirdNotifyInfoDetailsService");return thirdNotifyInfoDetailsService;}/*注入即时发送消息通知的接口*/private ThirdNotifyWebServiceImpl thirdNotifyWebService;private ThirdNotifyWebServiceImpl getThirdNotifyWebService() {if (thirdNotifyWebService == null)thirdNotifyWebService = (ThirdNotifyWebServiceImpl) SpringBeanUtil.getBean("thirdNotifyWebService");return thirdNotifyWebService;}/*** @param* @return void* @description: 外部系统消息通知定时任务服务执行方法* @author: 王雄峰* @date: 2023/10/17*/@Overridepublic void sendToNotifyInfoJob() throws Exception {try {//查询到需要推送的数据List<ThirdNotifyInfoDetails> sendDataList = getThirdNotifyInfoDetailsService().getSendJobData();//如果有符合条件的数据,那么进行则进行推送if (sendDataList.size() != 0) {//获取当前时间Date nowDate = new Date();for (int i = 0; i < sendDataList.size(); i++) {//遍历每一条数据ThirdNotifyInfoDetails infoDetails = sendDataList.get(i);if (infoDetails != null) {//获取当前数据中设置的定时时间与当前之前对比,如果当前时间大于数据中的时间,那么就就行推送Date notifySendTime = infoDetails.getNotifySendTime();//推送时间不为空,并且推送类型为钉钉推送方式if (notifySendTime != null && DINGTALK.equals(infoDetails.getNotifyType())) {//比较时间int dateResult = nowDate.compareTo(notifySendTime);//如果返回的结果小于0,则表示date1在date2之前;(date1<date2)//如果返回的结果大于0,则表示date1在date2之后;(date2<date1)//如果返回的结果等于0,则表示date1和date2相等if (dateResult > 0 || dateResult == 0) {//获取工号信息进行推送String senderNo = infoDetails.getNotifySenderNo();if (!"".equals(senderNo) && senderNo != "") {try {JSONObject sendResult = getThirdNotifyWebService().sendTodoFromResource(senderNo, infoDetails.getNotifySubject(), infoDetails.getNotifyContent());if (SUCCES.equals(sendResult.getString(RETURNSTATE))) {//更新标识,消息通知推送标识(未完成-0;已完成-1)infoDetails.setNotifyIsFlag("1");//更新数据的更新时间为当前时间infoDetails.setNotifyUpdateTime(nowDate);//更新数据getServiceImp().add(infoDetails);}String state = "编号:[" + senderNo + "]" + sendResult.getString(RETURNSTATE);String message = "编号:[" + senderNo + "]" + sendResult.getString(RETURNMESSAGE);logger.info("ThirdNotifyJobWebServiceImpl:外部系统消息通知定时任务服务接口调用状态:" + state + ";" + message + ";");} catch (Exception e) {logger.info("ThirdNotifyJobWebServiceImpl:外部系统消息通知定时任务服务接口调用异常");e.printStackTrace();}}}}}}} else {logger.info("ThirdNotifyJobWebServiceImpl:暂无需要推送的外部系统消息通知定时任务服务");}} catch (Exception e) {logger.info("ThirdNotifyJobWebServiceImpl:外部系统消息通知定时任务服务接口异常");e.printStackTrace();}}
}
  • 查询方法接口展示
package com.landray.kmss.third.notify.service;import com.landray.kmss.sys.metadata.interfaces.IExtendDataService;
import com.landray.kmss.third.notify.model.ThirdNotifyInfoDetails;import java.util.List;/*** 外部系统消息通知信息表 服务接口*/
public interface IThirdNotifyInfoDetailsService extends IExtendDataService {/*查询到需要发送消息通知的定时任务条件数据*/List<ThirdNotifyInfoDetails> getSendJobData() throws Exception;
}
  • 查询方法实现类展示
package com.landray.kmss.third.notify.service.spring;import com.landray.kmss.common.actions.RequestContext;
import com.landray.kmss.common.convertor.ConvertorContext;
import com.landray.kmss.common.dao.HQLInfo;
import com.landray.kmss.common.forms.IExtendForm;
import com.landray.kmss.common.model.IBaseModel;
import com.landray.kmss.sys.metadata.interfaces.ExtendDataServiceImp;
import com.landray.kmss.sys.notify.interfaces.ISysNotifyMainCoreService;
import com.landray.kmss.third.notify.model.ThirdNotifyInfoDetails;
import com.landray.kmss.third.notify.service.IThirdNotifyInfoDetailsService;
import com.landray.kmss.third.notify.util.ThirdNotifyUtil;
import com.landray.kmss.util.SpringBeanUtil;import java.util.Date;
import java.util.List;/*** 外部系统消息通知信息表 服务实现*/
public class ThirdNotifyInfoDetailsServiceImp extends ExtendDataServiceImp implements IThirdNotifyInfoDetailsService {private ISysNotifyMainCoreService sysNotifyMainCoreService;public IBaseModel convertBizFormToModel(IExtendForm form, IBaseModel model, ConvertorContext context) throws Exception {model = super.convertBizFormToModel(form, model, context);if (model instanceof ThirdNotifyInfoDetails) {ThirdNotifyInfoDetails thirdNotifyInfoDetails = (ThirdNotifyInfoDetails) model;}return model;}public IBaseModel initBizModelSetting(RequestContext requestContext) throws Exception {ThirdNotifyInfoDetails thirdNotifyInfoDetails = new ThirdNotifyInfoDetails();thirdNotifyInfoDetails.setNotifyCreateTime(new Date());thirdNotifyInfoDetails.setNotifyUpdateTime(new Date());ThirdNotifyUtil.initModelFromRequest(thirdNotifyInfoDetails, requestContext);return thirdNotifyInfoDetails;}public void initCoreServiceFormSetting(IExtendForm form, IBaseModel model, RequestContext requestContext) throws Exception {ThirdNotifyInfoDetails thirdNotifyInfoDetails = (ThirdNotifyInfoDetails) model;}public ISysNotifyMainCoreService getSysNotifyMainCoreService() {if (sysNotifyMainCoreService == null) {sysNotifyMainCoreService = (ISysNotifyMainCoreService) SpringBeanUtil.getBean("sysNotifyMainCoreService");}return sysNotifyMainCoreService;}/*查询到需要发送消息通知的定时任务条件数据*/@Overridepublic List<ThirdNotifyInfoDetails> getSendJobData() throws Exception {HQLInfo hqlInfo = new HQLInfo();try {hqlInfo.setWhereBlock("thirdNotifyInfoDetails.notifyPush = :notifyPush and thirdNotifyInfoDetails.notifyIsFlag = :notifyIsFlag");//消息通知推送类型(即时推送-1;定时推送-2;)即时推送则调用推送方法,定时则保存数据,等待定时任务进行推送hqlInfo.setParameter("notifyPush", "2");//消息通知推送标识(未完成-0;已完成-1)hqlInfo.setParameter("notifyIsFlag", "0");} catch (Exception e) {e.printStackTrace();}return this.findList(hqlInfo);}
}
  • 在spring中进行service的配置
    <!--外部系统消息通知定时任务服务接口-开始--><bean id="thirdNotifyJobWebService"class="com.landray.kmss.third.notify.webservice.impl.ThirdNotifyJobWebServiceImpl"/><!--外部系统消息通知定时任务服务接口-结束-->
  • 在design中配置quartz属性
    <!--外部系统消息通知定时任务服务接口-开始--><quartzmessageKey="third-notify:module.third.notify"jobService="thirdNotifyJobWebService"cronExpression="0 10 0 ? * *"jobMethod="sendToNotifyInfoJob"description="third-notify:module.third.notify.description"/><!--外部系统消息通知定时任务服务接口-结束-->
  • 系统配置中导入系统任务
    在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/108999.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

学习开发一个RISC-V上的操作系统(汪辰老师) — 一次RV32I加法指令的反汇编

前言 &#xff08;1&#xff09;此系列文章是跟着汪辰老师的RISC-V课程所记录的学习笔记。 &#xff08;2&#xff09;该课程相关代码gitee链接&#xff1b; &#xff08;3&#xff09;PLCT实验室实习生长期招聘&#xff1a;招聘信息链接 前置知识 RISC-V 汇编指令编码格式 &a…

AFL安全漏洞挖掘

安全之安全(security)博客目录导读 ATF(TF-A)/OPTEE之FUZZ安全漏洞挖掘汇总 目录 一、AFL简介 二、AFL的安装 三、代码示例及种子语料库 四、AFL插桩编译 五、AFL运行及测试 六、AFL结果分析 一、AFL简介 模糊测试&#xff08;Fuzzing&#xff09;技术作为漏洞挖掘最有…

Go项目踩坑:go get下载超时,goFrame框架下的go项目里将vue项目的dist同步打包发布,go项目打包并压缩

Go项目踩坑&#xff1a;go get下载超时&#xff0c;goFrame框架下的go项目里将vue项目的dist同步打包发布&#xff0c;go项目打包并压缩 go get下载超时goFrame打包静态资源vue项目打包gf pack生成go文件 静态资源使用打包发布go项目交叉编译&#xff0c;省略一些不必要的信息通…

基于闪电连接过程优化的BP神经网络(分类应用) - 附代码

基于闪电连接过程优化的BP神经网络&#xff08;分类应用&#xff09; - 附代码 文章目录 基于闪电连接过程优化的BP神经网络&#xff08;分类应用&#xff09; - 附代码1.鸢尾花iris数据介绍2.数据集整理3.闪电连接过程优化BP神经网络3.1 BP神经网络参数设置3.2 闪电连接过程算…

超越平凡:Topaz Photo AI for Mac带您领略人工智能降噪的魅力

在这个充满噪点和高频信息的时代&#xff0c;照片和视频的降噪成为了一个重要而迫切的需求。Mac用户现在有了一个强大的新工具——Topaz Photo AI for Mac&#xff0c;这是一款利用人工智能技术进行降噪和优化的软件。通过这款软件&#xff0c;您可以轻松地改善图像质量&#x…

Ps:变形

Ps菜单&#xff1a;编辑/变换/变形 Edit/Transform/Warp 变形 Warp是自由变换的一种模式&#xff0c;不仅可以用于物体的伸缩扭曲&#xff0c;也可用于人体的局部塑形。 除了从菜单打开&#xff0c;通常情况下&#xff0c;按 Ctrl T 进入自由变换&#xff0c;然后在画面上右击…

分享一份适合练手的软件测试实战项目

最近&#xff0c;不少读者托我找一个能实际练手的测试项目。开始&#xff0c;我觉得这是很简单的一件事&#xff0c;但当我付诸行动时&#xff0c;却发现&#xff0c;要找到一个对新手友好的练手项目&#xff0c;着实困难。 我翻了不下一百个web网页&#xff0c;包括之前推荐练…

单目3D自动标注

这里介绍两种 1. 基于SAM的点云标注 Seal&#xff1a;是一个多功能的自监督学习框架&#xff0c;能够通过利用视觉基础模型的现成知识和2D-3D的时空约束分割自动驾驶数据集点云 Scalability&#xff1a;可拓展性强&#xff0c;视觉基础模型蒸馏到点云中&#xff0c;避免2D和…

算法-堆/归并排序-排序链表

算法-堆/归并排序-排序链表 1 题目概述 1.1 题目出处 https://leetcode.cn/problems/sort-list/description/?envTypestudy-plan-v2&envIdtop-interview-150 1.2 题目描述 2 优先级队列构建大顶堆 2.1 思路 优先级队列构建小顶堆链表所有元素放入小顶堆依次取出堆顶…

30W网络对讲广播一体音柱

SV-7042T 30W网络对讲广播一体音柱 一、描述 SV-7042T是深圳锐科达电子有限公司的一款壁挂式网络有源音柱&#xff0c;具有10/100M以太网接口&#xff0c;可将网络音源通过自带的功放和喇叭输出播放&#xff0c;其采用防水设计&#xff0c;功率可以从20W到40W。SV-7042T作为网…

01【Git的基本使用与底层命令】

下一篇&#xff1a;02【Git的分支与数据恢复】 目录&#xff1a;【Git系列教程-目录大纲】 文章目录 一、Git概述1.1 Git简介1.2 集中式与分布式1.2.1 集中式版本控制1.2.2 分布式版本控制 1.3 Git的使用流程1.3.1 本地仓库1.3.2 协同开发 1.4 Git的配置1.4.1 Git的配置等级1…

华为汪涛:5.5G时代UBB目标网,跃升数字生产力

[阿联酋&#xff0c;迪拜&#xff0c;2023年10月12日] 在2023全球超宽带高峰论坛上&#xff0c;华为常务董事、ICT基础设施业务管理委员会主任汪涛发表了“5.5G时代UBB目标网&#xff0c;跃升数字生产力”的主题发言&#xff0c;分享了超宽带产业的最新思考与实践&#xff0c;探…

MySQL远程连接

一、什么是mysq的远程连接? 1、本地连接 直接在本地使用mysqladmin命令登录 mysql -u root -p 解释如下: mysql:mysql 命令表示要启动 MySQL 客户端。-u root:-u 选项指定要使用的用户名。在这里,我们使用 root 用户名作为示例。-p:-p 选项需要用户输入密码。如果省…

比postman更好用的接口管理软件——Apifox

比postman更好用的接口管理软件——Apifox 官网安装和登录Apifox功能使用团队管理&项目管理接口管理接口文档 Apifox 帮助文档 最近使用了一个好用的中文版接口管理软件&#xff0c;Apifox&#xff0c;以下介绍一下它的使用方式及好处。 官网 Apifox的官方地址&#xff1a…

Python制作PDF转Word工具(Tkinter+pdf2docx)

一、效果样式 二、核心点 1. 使用pdf2docx完成PDF转换Word 安装pdf2docx可能会报错&#xff0c;安装完成引入from pdf2docx import Converter运行也可能报错&#xff0c;可以根据报错提示看缺少那些库&#xff0c;先卸载pip uninstall xxx,使用pip install python-docx -i htt…

Stm32_标准库_16_串口蓝牙模块_手机与蓝牙模块通信_手机传入信息能对芯片时间日期进行更改

实现了手机发送信息给蓝牙模块&#xff0c;程序对数据进行分析拆解&#xff0c;并更新自身数据 main.c: #include "stm32f10x.h" // Device header #include "Delay.h" #include "OLED.h" #include "Serial.h" #include "Ti…

Docker仓库harbor私服搭建

Harbor和Registry都是Docker的镜像仓库&#xff0c;但是Harbor作为更多企业的选择&#xff0c;是因为相比较于Regisrty来说&#xff0c;它具有很多的优势。 提供分层传输机制&#xff0c;优化网络传输 Docker镜像是是分层的&#xff0c;而如果每次传输都使用全量文件(所以用FT…

特斯拉pre-test (Go)

特斯拉pre-test &#xff08;Go&#xff09; 1 Q12 Q23 Q3 1 Q1 原文&#xff1a; You are given an implementation of a function Solution that, given a positive integer N, prints to standard output another integer, which was formed by reversing a decimal repres…

基于Lang-Chain(ChatGLM和ChatChat)知识库大语言模型的部署搭建

环境准备 阿里云个人认证后&#xff0c;可免费试用机器学习平台PAI&#xff0c;可提供适合大语言模型环境搭建的高配置服务器。 点击试用阿里云服务器 试用产品选择&#xff1a;选择交互式建模PAI-DSW 适合哪些场景 文章/知识库/帮助文档等的检索基于现有知识库实现问答… …