bh add mqtt
parent
c31e4b6210
commit
42902276e9
@ -0,0 +1,37 @@
|
|||||||
|
package com.rehome.adminclientappmqttserver.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.rehome.adminclientappmqttserver.entity.Userbh;
|
||||||
|
import com.rehome.adminclientappmqttserver.entity.Useryf;
|
||||||
|
import com.rehome.adminclientappmqttserver.entity.Userzy;
|
||||||
|
import com.rehome.adminclientappmqttserver.service.UserbhService;
|
||||||
|
import com.rehome.adminclientappmqttserver.service.UseryfService;
|
||||||
|
import com.rehome.adminclientappmqttserver.service.UserzyService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器 博贺电厂
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author huangwenfei
|
||||||
|
* @since 2022-03-09
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/userBh")
|
||||||
|
public class UserbhController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserbhService userbhService;
|
||||||
|
|
||||||
|
public void saveUserBh(Userbh user){
|
||||||
|
userbhService.saveByUsernameBh(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package com.rehome.adminclientappmqttserver.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.hibernate.annotations.Proxy;
|
||||||
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author huangwenfei
|
||||||
|
* @since 2023-08-29
|
||||||
|
*/
|
||||||
|
@EntityListeners(AuditingEntityListener.class)
|
||||||
|
@Proxy(lazy = false)
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
public class Userbh implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
private String nfc;
|
||||||
|
|
||||||
|
@Column( length = 32)
|
||||||
|
private String date;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.rehome.adminclientappmqttserver.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.rehome.adminclientappmqttserver.entity.Userbh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类 博贺电厂
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author huangwenfei
|
||||||
|
* @since 2025-02-11
|
||||||
|
*/
|
||||||
|
public interface UserbhService {
|
||||||
|
public void saveByUsernameBh(Userbh user);
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package com.rehome.adminclientappmqttserver.service.impl;
|
||||||
|
|
||||||
|
import com.rehome.adminclientappmqttserver.dao.UserbhRepository;
|
||||||
|
import com.rehome.adminclientappmqttserver.entity.Userbh;
|
||||||
|
import com.rehome.adminclientappmqttserver.service.UserbhService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类 博贺电厂
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author huangwenfei
|
||||||
|
* @since 2025-02-11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional
|
||||||
|
public class UserbhServiceImpl implements UserbhService {
|
||||||
|
@Resource
|
||||||
|
private UserbhRepository userbhRepository;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveByUsernameBh(Userbh user) {
|
||||||
|
this.userbhRepository.save(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue