实训项目-人力资源管理系统-1Company子模块

目录

前言:

用例图设计:

 系统设计

开发方式:

 技术架构

系统结构:

API文档:

工程搭建:

搭建父项目

pom:

 创建公共子模块:

返回实体:

 分布式id生成器:

 创建实体类模块:

pom:

 创建company子模块:

pom:

CompanyApplication:

 Company类:

department类:

deplistResult类(封装部门列表) 

Controller:

CompanyController:

DepartmentController:

Dao: 

CompanyDao: 

Service:

CompanyService: 

DepartmentService:

Application:

 

此时子模块目录如下:

 


前言:

等实训周一到,哥们就把名字改过来,不然要被真实,此外,本项目除了SSM外以外,会用到其他刚学的插件,这下不得狠狠地在别人面前装一把,由于刚新建文件夹,请容我分成好几个博客来放出

用例图设计:

简单画一下,后面应该会扩展或者大改

 

 系统设计

开发方式:

 采用前后端分离(前端用啥还没想好,想好了我就把这里改了)

 技术架构

 前端:还没想好用啥

后端:spring全家桶(SpringBoot+SpringCloud+SpringMVC+SpringData)

ps:要是来不及我就改了

系统结构:

 后面画

API文档:

 没有

工程搭建:

搭建父项目

 

pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>org.flowerfog</groupId><artifactId>staff_parent</artifactId><version>1.0-SNAPSHOT</version><packaging>jar</packaging><name>staff_parent</name><url>http://maven.apache.org</url><description>staff-flowerfog</description><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.0.5.RELEASE</version><relativePath/></parent><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><java.version>17</java.version><fastjson.version>1.2.47</fastjson.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-logging</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>${fastjson.version}</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.16.16</version></dependency></dependencies><repositories><repository><id>spring-snapshots</id><name>Spring Snapshots</name><url>https://repo.spring.io/snapshot</url><snapshots><enabled>true</enabled></snapshots></repository><repository><id>spring-milestones</id><name>Spring Milestones</name><url>https://repo.spring.io/milestone</url><snapshots><enabled>false</enabled></snapshots></repository></repositories><pluginRepositories><pluginRepository><id>spring-snapshots</id><name>Spring Snapshots</name><url>https://repo.spring.io/snapshot</url><snapshots><enabled>true</enabled></snapshots></pluginRepository><pluginRepository><id>spring-milestones</id><name>Spring Milestones</name><url>https://repo.spring.io/milestone</url><snapshots><enabled>false</enabled></snapshots></pluginRepository></pluginRepositories><build><plugins><!--编译插件--><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.1</version><configuration><source>${java.version}</source><target>${java.version}</target></configuration></plugin><!--单元测试插件--><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>2.12.4</version><configuration><skipTests>true</skipTests></configuration></plugin></plugins></build>
</project>

 创建公共子模块:

返回实体:

 resultCode:

package org.flowerfog.entity;/*** 全局返回码*/
public enum ResultCode {SUCCESS(true,10000,"操作成功!"),//---系统错误返回码-----FAIL(false,10001,"操作失败"),UNAUTHENTICATED(false,10002,"您还未登录"),UNAUTHORISE(false,10003,"权限不足"),SERVER_ERROR(false,99999,"抱歉,系统繁忙,请稍后重试!");//其他操作码暂定//操作是否成功boolean success;//操作代码int code;//提示信息String message;ResultCode(boolean success,int code, String message){this.success = success;this.code = code;this.message = message;}public boolean success() {return success;}public int code() {return code;}public String message() {return message;}}

 其他code暂定

result:

package org.flowerfog.entity;import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;/*** 响应对象**/@Data
@NoArgsConstructor
public class Result {private boolean success;//是否成功private Integer code;//返回码private String message;//返回信息private Object data;//返回数据public Result(ResultCode code) {this.success = code.success;this.code = code.code;this.message = code.message;}public Result(ResultCode code,Object data) {this.success = code.success;this.code = code.code;this.message = code.message;this.data = data;}public Result(Integer code,String message,boolean success) {this.code = code;this.message = message;this.success = success;}public static Result SUCCESS(){return new Result(ResultCode.SUCCESS);}public static Result ERROR(){return new Result(ResultCode.SERVER_ERROR);}public static Result FAIL(){return new Result(ResultCode.FAIL);}
}

 分布式id生成器:

雪花算法:

package org.flowerfog.utils;import java.lang.management.ManagementFactory;
import java.net.InetAddress;
import java.net.NetworkInterface;//雪花算法代码实现
public class IdWorker {// 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动)private final static long twepoch = 1288834974657L;// 机器标识位数private final static long workerIdBits = 5L;// 数据中心标识位数private final static long datacenterIdBits = 5L;// 机器ID最大值private final static long maxWorkerId = -1L ^ (-1L << workerIdBits);// 数据中心ID最大值private final static long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);// 毫秒内自增位private final static long sequenceBits = 12L;// 机器ID偏左移12位private final static long workerIdShift = sequenceBits;// 数据中心ID左移17位private final static long datacenterIdShift = sequenceBits + workerIdBits;// 时间毫秒左移22位private final static long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;private final static long sequenceMask = -1L ^ (-1L << sequenceBits);/* 上次生产id时间戳 */private static long lastTimestamp = -1L;// 0,并发控制private long sequence = 0L;private final long workerId;// 数据标识id部分private final long datacenterId;public IdWorker(){this.datacenterId = getDatacenterId(maxDatacenterId);this.workerId = getMaxWorkerId(datacenterId, maxWorkerId);}/*** @param workerId*            工作机器ID* @param datacenterId*            序列号*/public IdWorker(long workerId, long datacenterId) {if (workerId > maxWorkerId || workerId < 0) {throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));}if (datacenterId > maxDatacenterId || datacenterId < 0) {throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));}this.workerId = workerId;this.datacenterId = datacenterId;}/*** 获取下一个ID** @return*/public synchronized long nextId() {long timestamp = timeGen();if (timestamp < lastTimestamp) {throw new RuntimeException(String.format("Clock moved backwards.  Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));}if (lastTimestamp == timestamp) {// 当前毫秒内,则+1sequence = (sequence + 1) & sequenceMask;if (sequence == 0) {// 当前毫秒内计数满了,则等待下一秒timestamp = tilNextMillis(lastTimestamp);}} else {sequence = 0L;}lastTimestamp = timestamp;// ID偏移组合生成最终的ID,并返回IDlong nextId = ((timestamp - twepoch) << timestampLeftShift)| (datacenterId << datacenterIdShift)| (workerId << workerIdShift) | sequence;return nextId;}private long tilNextMillis(final long lastTimestamp) {long timestamp = this.timeGen();while (timestamp <= lastTimestamp) {timestamp = this.timeGen();}return timestamp;}private long timeGen() {return System.currentTimeMillis();}/*** <p>* 获取 maxWorkerId* </p>*/protected static long getMaxWorkerId(long datacenterId, long maxWorkerId) {StringBuffer mpid = new StringBuffer();mpid.append(datacenterId);String name = ManagementFactory.getRuntimeMXBean().getName();if (!name.isEmpty()) {/** GET jvmPid*/mpid.append(name.split("@")[0]);}/** MAC + PID 的 hashcode 获取16个低位*/return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1);}/*** <p>* 数据标识id部分* </p>*/protected static long getDatacenterId(long maxDatacenterId) {long id = 0L;try {InetAddress ip = InetAddress.getLocalHost();NetworkInterface network = NetworkInterface.getByInetAddress(ip);if (network == null) {id = 1L;} else {byte[] mac = network.getHardwareAddress();id = ((0x000000FF & (long) mac[mac.length - 1])| (0x0000FF00 & (((long) mac[mac.length - 2]) << 8))) >> 6;id = id % (maxDatacenterId + 1);}} catch (Exception e) {System.out.println(" getDatacenterId: " + e.getMessage());}return id;}
}

 创建实体类模块:

 跟上面一样的步骤

pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.flowerfog</groupId><artifactId>staff_parent</artifactId><version>1.0-SNAPSHOT</version></parent><artifactId>staff-common-model</artifactId><packaging>war</packaging><name>staff-common-model Maven Webapp</name><url>http://maven.apache.org</url><dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>3.8.1</version><scope>test</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-jpa</artifactId></dependency><dependency><groupId>org.flowerfog</groupId><artifactId>staff-common</artifactId><version>1.0-SNAPSHOT</version></dependency></dependencies><build><finalName>staff-common-model</finalName></build>
</project>

 创建company子模块:

pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.flowerfog</groupId><artifactId>staff_parent</artifactId><version>1.0-SNAPSHOT</version></parent><artifactId>staff-company</artifactId><packaging>war</packaging><name>staff-company Maven Webapp</name><url>http://maven.apache.org</url><dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>3.8.1</version><scope>test</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-jpa</artifactId></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId></dependency><dependency><groupId>org.flowerfog</groupId><artifactId>staff-common</artifactId><version>1.0-SNAPSHOT</version></dependency><dependency><groupId>org.flowerfog</groupId><artifactId>staff-common-model</artifactId><version>1.0-SNAPSHOT</version></dependency></dependencies><build><finalName>staff-company</finalName></build>
</project>

CompanyApplication:

package org.flowerfog.company;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;//1.扫描包
@SpringBootApplication(scanBasePackages = "org.flowerfog.company")
//2.jap注解扫描
@EntityScan(value = "org.flowerfog.domain.company")
public class CompanyApplication {/*** 启动方法*/public static void main(String[] args) {SpringApplication.run(CompanyApplication.class,args);}}

 Company类:

package org.flowerfog.domain.company;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;@Data
@AllArgsConstructor
public class Company implements Serializable {private static final long serialVersionUID = 594829320797158219L;//ID@Idprivate String id;/*** 公司名称*/private String name;/*** 企业登录账号ID*/private String managerId;/*** 当前版本*/private String version;/*** 续期时间*/private Date renewalDate;/*** 到期时间*/private Date expirationDate;/*** 公司地区*/private String companyArea;/*** 公司地址*/private String companyAddress;/*** 营业执照-图片ID*/private String businessLicenseId;/*** 法人代表*/private String legalRepresentative;/*** 公司电话*/private String companyPhone;/*** 邮箱*/private String mailbox;/*** 公司规模*/private String companySize;/*** 所属行业*/private String industry;/*** 备注*/private String remarks;/*** 审核状态*/private String auditState;/*** 状态*/private Integer state;/*** 当前余额*/private Double balance;/*** 创建时间*/private Date createTime;
}

department类:

package org.flowerfog.domain.company;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.List;/*** (Department)实体类*/
@Entity
@Table(name = "co_department")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department implements Serializable {private static final long serialVersionUID = -9084332495284489553L;//ID@Idprivate String id;/*** 父级ID*/private String pid;/*** 企业ID*/private String companyId;/*** 部门名称*/private String name;/*** 部门编码,同级部门不可重复*/private String code;/*** 负责人ID*/private String managerId;/***  负责人名称*/private String manager;/*** 介绍*/private String introduce;/*** 创建时间*/private Date createTime;
}

deplistResult类(封装部门列表) 

package org.flowerfog.domain.company.response;import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.flowerfog.domain.company.Company;
import org.flowerfog.domain.company.Department;import java.util.List;@Getter
@Setter
@NoArgsConstructor
public class DeptListResult {private String companyId;private String companyName;private String companyManage;private List<Department> depts;public DeptListResult(Company company,List depts){this.companyId = company.getId();this.companyName = company.getName();this.companyManage = company.getLegalRepresentative();//公司联系人this.depts = depts;}}

Controller:

CompanyController:

package org.flowerfog.company.controller;import org.flowerfog.company.service.CompanyService;
import org.flowerfog.domain.company.Company;
import org.flowerfog.entity.Result;
import org.flowerfog.entity.ResultCode;
import org.flowerfog.exception.CommonException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;import java.util.List;//解决跨域
@CrossOrigin
@RestController
@RequestMapping(value = "/company")
public class CompanyController {@Autowiredprivate CompanyService companyService;//保存企业@RequestMapping(value = "",method = RequestMethod.POST)public Result save(@RequestBody Company company){//业务companyService.add(company);return new Result(ResultCode.SUCCESS);}//根据id更新企业@RequestMapping(value = "/{id}",method = RequestMethod.PUT)public Result update(@PathVariable(value = "id") String id,@RequestBody Company company){//业务company.setId(id);companyService.update(company);return new Result(ResultCode.SUCCESS);}//删除企业@RequestMapping(value = "/{id}",method = RequestMethod.DELETE)public Result delete(@PathVariable(value = "id") String id){companyService.deleteById(id);return new Result(ResultCode.SUCCESS);}//查询@RequestMapping(value = "/{id}",method = RequestMethod.GET)public Result findById(@PathVariable(value = "id") String id) throws CommonException {Company company = companyService.findById(id);Result result = new Result((ResultCode.SUCCESS));result.setData(company);return result;}//查询列表@RequestMapping(value = "",method = RequestMethod.GET)public Result findAll(){//        int i = 1/0;List<Company> List = companyService.findAll();Result result = new Result(ResultCode.SUCCESS);result.setData(List);return result;}
}

DepartmentController:

 

package org.flowerfog.company.controller;import com.sun.xml.internal.bind.v2.TODO;
import org.flowerfog.company.service.CompanyService;
import org.flowerfog.company.service.DepartmentService;
import org.flowerfog.controller.BaseController;
import org.flowerfog.domain.company.Company;
import org.flowerfog.domain.company.Department;
import org.flowerfog.domain.company.response.DeptListResult;
import org.flowerfog.entity.Result;
import org.flowerfog.entity.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;import java.util.List;@CrossOrigin
@RequestMapping(value = "/company")
@RestController
public class DepartmentController extends BaseController {@Autowiredprivate DepartmentService departmentService;@Autowiredprivate CompanyService companyService;/*** 保存* @param department* @return*/@RequestMapping(value = "/department",method = RequestMethod.POST)public Result save(@RequestBody Department department){//设置id/*** 企业id:使用固定值*/department.setCompanyId(companyId);//调用servicedepartmentService.save(department);return new Result(ResultCode.SUCCESS);}/*** 查询部门列表* @return*/@RequestMapping(value = "/department",method = RequestMethod.GET)public Result findAll(){// idCompany company = companyService.findById(companyId);List<Department> list = departmentService.findAll(companyId);//返回DeptListResult deptListResult = new DeptListResult(company,list);return new Result(ResultCode.SUCCESS,deptListResult);}@RequestMapping(value = "/department/{id}",method = RequestMethod.GET)public Result findById(@PathVariable(value = "id") String id){Department department = departmentService.findById(id);return new Result(ResultCode.SUCCESS,department);}@RequestMapping(value = "/department/{id}",method = RequestMethod.POST)public Result update(@PathVariable(value = "id") String id,@RequestBody Department department){Department dep = departmentService.findById(id);dep.setId(department.getId());departmentService.update(dep);return new Result(ResultCode.SUCCESS);}@RequestMapping(value = "/department/{id}",method = RequestMethod.DELETE)public Result delete(@PathVariable(value = "id") String id){departmentService.deleteById(id);return new Result(ResultCode.SUCCESS);}
}

Dao: 

CompanyDao: 

package org.flowerfog.company.dao;import org.flowerfog.domain.company.Company;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;/*** 自定义dao接口继承*      JpaRepository<实体类,主键>*      JpaSpecificationExecutor<实体类>*/
public interface CompanyDao extends JpaRepository<Company,String> ,JpaSpecificationExecutor<Company> {
}

DepartmentDao就不放了,跟上面同理

Service:

CompanyService: 

package org.flowerfog.company.service;import org.flowerfog.company.dao.CompanyDao;
import org.flowerfog.domain.company.Company;
import org.flowerfog.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import java.util.List;@Service
public class CompanyService {@Autowiredprivate CompanyDao companyDao;@Autowiredprivate IdWorker idWorker;/*** 保存企业*  1.配置idwork到工程*  2.在service中注入idwork*  3.通过idwork生成id*  4.保存企业*/public void add(Company company) {//基本属性的设置String id = idWorker.nextId()+"";company.setId(id);//默认的状态company.setAuditState("0");//0:未审核,1:已审核company.setState(1); //0.未激活,1:已激活companyDao.save(company);}/*** 更新企业*  1.参数:Company*  2.根据id查询企业对象*  3.设置修改的属性*  4.调用dao完成更新*/public void update(Company company) {Company temp = companyDao.findById(company.getId()).get();temp.setName(company.getName());temp.setCompanyPhone(company.getCompanyPhone());companyDao.save(temp);}/*** 删除企业*/public void deleteById(String id) {companyDao.deleteById(id);}/*** 根据id查询企业*/public Company findById(String id) {return companyDao.findById(id).get();}/*** 查询企业列表*/public List<Company> findAll() {return companyDao.findAll();}
}

DepartmentService:

package org.flowerfog.company.service;import org.flowerfog.company.dao.DepartmentDao;
import org.flowerfog.domain.company.Department;
import org.flowerfog.service.BaseService;
import org.flowerfog.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.List;@Service
public class DepartmentService extends BaseService {@Autowiredprivate DepartmentDao departmentDao;@Autowiredprivate IdWorker idWorker;/*** 保存部门*/public void save(Department department){//设置主键值String id =idWorker.nextId()+"";department.setId(id);//调用dao保存departmentDao.save(department);}/*** 更新部门*/public void update(Department department){//查询Department dept = departmentDao.findById(department.getId()).get();//设置修改属性dept.setCode(department.getCode());dept.setIntroduce(department.getIntroduce());dept.setName(department.getName());//更新部门departmentDao.save(dept);}/*** 根据id查询*/public Department findById(String id){return departmentDao.findById(id).get();}/*** 查询全部*///TODOpublic List<Department> findAll(String companyId){
//        Specification<Department> spec = new Specification<Department>() {
//
//            @Override
//            public Predicate toPredicate(Root<Department> root, CriteriaQuery<?> cq, CriteriaBuilder cb) {
//                //根据id查询
//                return cb.equal(root.get("companyId").as(String.class),id);
//            }
//        };return departmentDao.findAll(getSpec(companyId));}/*** id删除部门*/public void deleteById(String id){departmentDao.deleteById(id);}
}

Application:

 

package org.flowerfog.company;import org.flowerfog.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;//1.配置springboot的包扫描
@SpringBootApplication(scanBasePackages = "org.flowerfog")
//2.配置jpa注解的扫描
@EntityScan(value="org.flowerfog.domain.company")
public class CompanyApplication {/*** 启动方法*/public static void main(String[] args) {SpringApplication.run(CompanyApplication.class,args);}@Beanpublic IdWorker idWorker() {return new IdWorker();}
}

此时子模块目录如下:

 

至此,Company子模块构建成功 

 

 

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

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

相关文章

2.5.3 文件使用、共享、保护、安全与可靠性

文章目录 文件使用文件共享文件保护系统安全与可靠性 文件使用 操作系统向用户提供操作级、编程级文件服务。 操作级服务包括目录管理&#xff0c;文件操作&#xff08;复制、删除、修改&#xff09;&#xff0c;文件管理&#xff08;设置文件权限&#xff09;。 编程级服务包括…

路由器转发数据报的封装过程

✍作者&#xff1a;柒烨带你飞 &#x1f4aa;格言&#xff1a;生活的情况越艰难&#xff0c;我越感到自己更坚强&#xff1b;我这个人走得很慢&#xff0c;但我从不后退。 &#x1f4dc;系列专栏&#xff1a;网路安全入门系列 目录 路由器转发数据的封装过程 路由器转发数据的封…

vulnhub matrix-breakout靶机

1.搭建靶机 这样就是装好了 获取靶机IP nmap -O 192.168.47.129/24 2.信息收集 dirb http://192.168.47.128 dirb 首页 81端口一个登录页面 gobuster dir -u http://192.168.152.154 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,txt,html gra…

微信小程序 不同角色进入不同页面、呈现不同底部导航栏

遇到这个需求之前一直使用的小程序默认底部导航栏&#xff0c;且小程序默认入口页面为pages/index/index&#xff0c;要使不同角色呈现不同底部导航栏&#xff0c;必须要在不同页面引用不同的自定义导航栏。本篇将结合分包&#xff08;subPackages&#xff09;展开以下三步叙述…

如何通过 Kafka 将数据导入 Elasticsearch

作者&#xff1a;来自 Elastic Andre Luiz 将 Apache Kafka 与 Elasticsearch 集成的分步指南&#xff0c;以便使用 Python、Docker Compose 和 Kafka Connect 实现高效的数据提取、索引和可视化。 在本文中&#xff0c;我们将展示如何将 Apache Kafka 与 Elasticsearch 集成以…

LLaMA-Factory GLM4-9B-CHAT LoRA 微调实战

&#x1f929;LLaMA-Factory GLM LoRA 微调 安装llama-factory包 git clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git进入下载好的llama-factory&#xff0c;安装依赖包 cd LLaMA-Factory pip install -e ".[torch,metrics]" #上面这步操作会完成…

view draw aosp15

基础/背景知识 如何理解Drawable&#xff1f; 在 Android 中&#xff0c;Drawable 是一个抽象的概念&#xff0c;表示可以绘制到屏幕上的内容。 它可以是位图图像、矢量图形、形状、颜色等。 Drawable 本身并不是一个 View&#xff0c;它不能直接添加到布局中&#xff0c;而是…

gridcontrol表格某一列设置成复选框,选择多行(repositoryItemCheckEdit1)

1. 往表格中添加repositoryItemCheckEdit1 2. 事件&#xff1a; repositoryItemCheckEdit1.QueryCheckStateByValue repositoryItemCheckEdit1_QueryCheckStateByValue; private void repositoryItemCheckEdit1_QueryCheckStateByValue(object sender, DevExpress.XtraEditor…

重温设计模式--适配器模式

文章目录 适配器模式&#xff08;Adapter Pattern&#xff09;概述适配器模式UML图适配器模式的结构目标接口&#xff08;Target&#xff09;&#xff1a;适配器&#xff08;Adapter&#xff09;&#xff1a;被适配者&#xff08;Adaptee&#xff09;&#xff1a; 作用&#xf…

C语言项目 天天酷跑(上篇)

前言 这里讲述这个天天酷跑是怎么实现的&#xff0c;我会在天天酷跑的下篇添加源代码&#xff0c;这里会讲述天天酷跑这个项目是如何实现的每一个思路&#xff0c;都是作者自己学习于别人的代码而创作的项目和思路&#xff0c;这个代码和网上有些许不一样&#xff0c;因为掺杂了…

公交车信息管理系统:构建智能城市交通的基石

程序设计 本系统主要使用Java语言编码设计功能&#xff0c;MySQL数据库管控数据信息&#xff0c;SSM框架创建系统架构&#xff0c;通过这些关键技术对系统进行详细设计&#xff0c;设计和实现系统相关的功能模块。最后对系统进行测试&#xff0c;这一环节的结果&#xff0c;基本…

MDS-NPV/NPIV

在存储区域网络&#xff08;SAN&#xff09;中&#xff0c;域ID&#xff08;Domain ID&#xff09;是一个用于区分不同存储区域的关键参数。域ID允许SAN环境中的不同部分独立操作&#xff0c;从而提高效率和安全性。以下是关于域ID的一些关键信息&#xff1a; 域ID的作用&…

【网络安全产品大调研系列】1. 漏洞扫描

1. 为什么会出现漏扫技术&#xff1f; 每次黑客攻击事件进行追溯的时候&#xff0c;根据日志分析后&#xff0c;我们往往发现基本都是系统、Web、 弱口令、配置这四个方面中的其中一个出现的安全问题导致黑客可以轻松入侵的。 操作系统的版本滞后&#xff0c;没有更新补丁&am…

验证 Dijkstra 算法程序输出的奥秘

一、引言 Dijkstra 算法作为解决图中单源最短路径问题的经典算法,在网络路由、交通规划、资源分配等众多领域有着广泛应用。其通过不断选择距离源节点最近的未访问节点,逐步更新邻居节点的最短路径信息,以求得从源节点到其他所有节点的最短路径。在实际应用中,确保 Dijkst…

【论文阅读笔记】Learning to sample

Learning to sample 前沿引言方法问题声明S-NET匹配ProgressiveNet: sampling as ordering 实验分类检索重建 结论附录 前沿 这是一篇比较经典的基于深度学习的点云下采样方法 核心创新点&#xff1a; 首次提出了一种学习驱动的、任务特定的点云采样方法引入了两种采样网络&…

Mysql大数据量表分页查询性能优化

一、模拟场景 1、产品表t_product,数据量500万+ 2、未做任何优化前,cout查询时间大约4秒;LIMIT offset, count 时,offset 值较大时查询时间越久。 count查询 SELECT COUNT(*) AS total FROM t_product WHERE deleted = 0 AND tenant_id = 1 分页查询 SELECT * FROM t_…

pythonWeb~伍~初识Django

初识Django 1.技术栈 Python知识点&#xff1a;函数、面向对象。前端知识点&#xff1a;HTML、CSS、JavaScript、jQuery、BootStrap。MySQL数据库。Python的Web框架&#xff1a; Flask&#xff0c;自身短小精悍 第三方组件。Django&#xff0c;内部已集成了很多组件 第三方…

kimi搜索AI多线程批量生成txt原创文章软件-不需要账号及key

kimi搜索AI多线程批量生成txt原创文章软件介绍&#xff1a; 软件可以设置三种模型写文章&#xff1a;kimi&#xff1a;默认AI模型&#xff0c;kimi-search&#xff1a;联网检索模型 &#xff0c;kimi-research&#xff1a;探索版搜索聚合模型 1、可以设置写联网搜索文章&#…

DevNow x Notion

前言 Notion 应该是目前用户量比较大的一个在线笔记软件&#xff0c;它的文档系统也非常完善&#xff0c;支持多种文档格式&#xff0c;如 Markdown、富文本、表格、公式等。 早期我也用过一段时间&#xff0c;后来有点不习惯&#xff0c;就换到了 Obsidian &#xff0c;但是…

CSPM认证最推荐学习哪个级别?

一、什么是CSPM&#xff1f; CSPM的全称是Certified Strategic Project Manager&#xff0c;中文名称为“项目管理专业人员能力评价等级证书”。这是由中国标准化协会依据国家标准《项目管理专业人员能力评价要求》&#xff08;GB/T 41831-2022&#xff09;推出的一项认证&…