Commit 9c1fdb8b authored by zengtianlai3's avatar zengtianlai3

删除DeviceType

parent 02dc3069
package iot.sixiang.license.controller;
import iot.sixiang.license.entity.DeviceType;
import iot.sixiang.license.model.ResResult;
import iot.sixiang.license.service.DeviceTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author m33
* @since 2022-06-08
*/
@RestController
@RequestMapping("/iot_license/device_type")
public class DeviceTypeController {
@Autowired
private DeviceTypeService deviceTypeService;
/**
* 查询所有的device_type
* @param
* @return
*/
@GetMapping("type")
public ResResult getDeviceTypeList() {
List<DeviceType> records = deviceTypeService.getDeviceTypeList();
return ResResult.success().record(records);
}
}
package iot.sixiang.license.service;
import iot.sixiang.license.entity.DeviceType;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author m33
* @since 2022-06-08
*/
public interface DeviceTypeService {
List<DeviceType> getDeviceTypeList();
}
package iot.sixiang.license.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import iot.sixiang.license.entity.DeviceType;
import iot.sixiang.license.mapper.DeviceTypeMapper;
import iot.sixiang.license.service.DeviceTypeService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author m33
* @since 2022-06-08
*/
@Service
public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceType> implements DeviceTypeService {
@Resource
private DeviceTypeMapper deviceTypeMapper;
@Override
public List<DeviceType> getDeviceTypeList() {
List<DeviceType> deviceTypes = deviceTypeMapper.getDeviceTypeList();
return deviceTypes;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="iot.sixiang.license.mapper.DeviceTypeMapper">
<!-- <sql id="DeviceTypeVoColumn">-->
<!-- dt.type_id,dt.type_name,de.sn,us.user_id,us.user_name,us.password,us.company-->
<!-- </sql>-->
<select id="getDeviceTypeList" resultType="iot.sixiang.license.entity.DeviceType">
SELECT type_id, type_name FROM device_type
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment