Просмотр исходного кода

20230717(2)-增加部分接口(未完成)

iaun 3 лет назад
Родитель
Сommit
d7016210cc

+ 20 - 0
src/main/java/cn/iaun/it/config/MyBatisPlusConfig.java

@@ -0,0 +1,20 @@
+package cn.iaun.it.config;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@MapperScan("cn.iaun.it.mapper")
+public class MyBatisPlusConfig {
+
+    @Bean
+    public MybatisPlusInterceptor mybatisPlusInterceptor() {
+        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
+        return interceptor;
+    }
+}

+ 9 - 0
src/main/java/cn/iaun/it/controller/ItResourceController.java

@@ -0,0 +1,9 @@
+package cn.iaun.it.controller;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/resource")
+public class ItResourceController {
+}

+ 60 - 0
src/main/java/cn/iaun/it/model/ItResource.java

@@ -0,0 +1,60 @@
+package cn.iaun.it.model;
+
+public class ItResource {
+    private Long resourceId;
+    private String resourceName;
+    private Long typeId;
+    private Long groupId;
+    private String remark;
+
+    @Override
+    public String toString() {
+        return "ItResource{" +
+                "resourceId=" + resourceId +
+                ", resourceName='" + resourceName + '\'' +
+                ", typeId=" + typeId +
+                ", groupId=" + groupId +
+                ", remark='" + remark + '\'' +
+                '}';
+    }
+
+    public Long getResourceId() {
+        return resourceId;
+    }
+
+    public void setResourceId(Long resourceId) {
+        this.resourceId = resourceId;
+    }
+
+    public String getResourceName() {
+        return resourceName;
+    }
+
+    public void setResourceName(String resourceName) {
+        this.resourceName = resourceName;
+    }
+
+    public Long getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(Long typeId) {
+        this.typeId = typeId;
+    }
+
+    public Long getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(Long groupId) {
+        this.groupId = groupId;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+}

+ 90 - 0
src/main/java/cn/iaun/it/model/ItResourceAttribute.java

@@ -0,0 +1,90 @@
+package cn.iaun.it.model;
+
+public class ItResourceAttribute {
+    private Long attributeId;
+    private Long groupId;
+    private String attributeName;
+    private String displayName;
+    private Integer attributeType;
+    private Integer valueType;
+    private String defaultValue;
+    private String options;
+
+    @Override
+    public String toString() {
+        return "ItResourceAttribute{" +
+                "attributeId=" + attributeId +
+                ", groupId=" + groupId +
+                ", attributeName='" + attributeName + '\'' +
+                ", displayName='" + displayName + '\'' +
+                ", attributeType=" + attributeType +
+                ", valueType=" + valueType +
+                ", defaultValue='" + defaultValue + '\'' +
+                ", options='" + options + '\'' +
+                '}';
+    }
+
+    public Long getAttributeId() {
+        return attributeId;
+    }
+
+    public void setAttributeId(Long attributeId) {
+        this.attributeId = attributeId;
+    }
+
+    public Long getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(Long groupId) {
+        this.groupId = groupId;
+    }
+
+    public String getAttributeName() {
+        return attributeName;
+    }
+
+    public void setAttributeName(String attributeName) {
+        this.attributeName = attributeName;
+    }
+
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public void setDisplayName(String displayName) {
+        this.displayName = displayName;
+    }
+
+    public Integer getAttributeType() {
+        return attributeType;
+    }
+
+    public void setAttributeType(Integer attributeType) {
+        this.attributeType = attributeType;
+    }
+
+    public Integer getValueType() {
+        return valueType;
+    }
+
+    public void setValueType(Integer valueType) {
+        this.valueType = valueType;
+    }
+
+    public String getDefaultValue() {
+        return defaultValue;
+    }
+
+    public void setDefaultValue(String defaultValue) {
+        this.defaultValue = defaultValue;
+    }
+
+    public String getOptions() {
+        return options;
+    }
+
+    public void setOptions(String options) {
+        this.options = options;
+    }
+}

+ 30 - 0
src/main/java/cn/iaun/it/model/ItResourceGroup.java

@@ -0,0 +1,30 @@
+package cn.iaun.it.model;
+
+public class ItResourceGroup {
+    private Long groupId;
+    private String groupName;
+
+    @Override
+    public String toString() {
+        return "ItResourceGroup{" +
+                "groupId=" + groupId +
+                ", groupName='" + groupName + '\'' +
+                '}';
+    }
+
+    public Long getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(Long groupId) {
+        this.groupId = groupId;
+    }
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+}

+ 40 - 0
src/main/java/cn/iaun/it/model/ItResourceType.java

@@ -0,0 +1,40 @@
+package cn.iaun.it.model;
+
+public class ItResourceType {
+    private Long typeId;
+    private String typeName;
+    private Long parentTypeId;
+
+    @Override
+    public String toString() {
+        return "ItResourceType{" +
+                "typeId=" + typeId +
+                ", typeName='" + typeName + '\'' +
+                ", parentTypeId=" + parentTypeId +
+                '}';
+    }
+
+    public Long getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(Long typeId) {
+        this.typeId = typeId;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+
+    public Long getParentTypeId() {
+        return parentTypeId;
+    }
+
+    public void setParentTypeId(Long parentTypeId) {
+        this.parentTypeId = parentTypeId;
+    }
+}

+ 40 - 0
src/main/java/cn/iaun/it/model/ItResourceValue.java

@@ -0,0 +1,40 @@
+package cn.iaun.it.model;
+
+public class ItResourceValue {
+    private Long resourceId;
+    private Long attributeId;
+    private String attributeValue;
+
+    @Override
+    public String toString() {
+        return "ItResourceValue{" +
+                "resourceId=" + resourceId +
+                ", attributeId=" + attributeId +
+                ", attributeValue='" + attributeValue + '\'' +
+                '}';
+    }
+
+    public Long getResourceId() {
+        return resourceId;
+    }
+
+    public void setResourceId(Long resourceId) {
+        this.resourceId = resourceId;
+    }
+
+    public Long getAttributeId() {
+        return attributeId;
+    }
+
+    public void setAttributeId(Long attributeId) {
+        this.attributeId = attributeId;
+    }
+
+    public String getAttributeValue() {
+        return attributeValue;
+    }
+
+    public void setAttributeValue(String attributeValue) {
+        this.attributeValue = attributeValue;
+    }
+}

+ 27 - 0
src/main/java/cn/iaun/it/service/ItResourceService.java

@@ -0,0 +1,27 @@
+package cn.iaun.it.service;
+
+import cn.iaun.it.model.ItResourceGroup;
+import cn.iaun.it.model.ItResourceType;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+public interface ItResourceService {
+    List<ItResourceGroup> getResourceGroup();
+
+    boolean addResourceGroup(Long id);
+
+    boolean delResourceGroup(Long id);
+
+    boolean setResourceGroup(Long id, ItResourceType itResourceType);
+
+    List<ItResourceType> getResourceType();
+
+    boolean addResourceType(Long id);
+
+    boolean delResourceType(Long id);
+
+    boolean setResourceType(Long id, ItResourceType itResourceType);
+
+
+}