Browse Source

Merge branch 'dev' of http://git.izouma.com/xiongzhu/raex_back into dev

panhui 3 years ago
parent
commit
b6cb1cac79

+ 1 - 0
src/main/java/com/izouma/nineth/config/WebMvcConfig.java

@@ -42,6 +42,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
         registry.addResourceHandler("/files/**").addResourceLocations("file:" + localPath);
         registry.addResourceHandler("/MP_verify*").addResourceLocations("classpath:/");
         registry.addResourceHandler("/u951658VPf.txt").addResourceLocations("classpath:/static/");
+        registry.addResourceHandler("/u9s1658vPf.txt").addResourceLocations("classpath:/static/");
     }
 
     @Bean

+ 54 - 0
src/main/java/com/izouma/nineth/domain/UserDetail.java

@@ -0,0 +1,54 @@
+package com.izouma.nineth.domain;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+public class UserDetail extends BaseEntityNoID {
+
+    @ApiModelProperty("用户id")
+    @Id
+    private Long userId;
+
+    @ApiModelProperty("生日")
+    private String birthday;
+
+    @ApiModelProperty("性别")
+    private String sex;
+
+    @ApiModelProperty("职业")
+    private String occupation;
+
+    @ApiModelProperty("血型")
+    private String blood;
+
+    @ApiModelProperty("星座")
+    private String constellation;
+
+    @ApiModelProperty("邮箱")
+    private String mail;
+
+    @ApiModelProperty("家乡")
+    private String home;
+
+    @ApiModelProperty("学校")
+    private String school;
+
+    @ApiModelProperty("公司")
+    private String company;
+
+    @ApiModelProperty("个人签名")
+    private String autograph;
+
+}

+ 1 - 1
src/main/java/com/izouma/nineth/security/WebSecurityConfig.java

@@ -166,7 +166,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/metaUser/internalTest").permitAll()
                 .antMatchers("/metaShowRoomAsset/**").permitAll()
                 .antMatchers("/u951658VPf.txt").permitAll()
-
+                .antMatchers("/u9s1658vPf.txt").permitAll()
                 // all other requests need to be authenticated
                 .anyRequest().authenticated().and()
                 // make sure we use stateless session; session won't be used to

+ 28 - 0
src/main/java/com/izouma/nineth/service/UserDetailService.java

@@ -0,0 +1,28 @@
+package com.izouma.nineth.service;
+
+import com.izouma.nineth.domain.UserDetail;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.repo.AssetRepo;
+import com.izouma.nineth.utils.JpaUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+@Service
+@AllArgsConstructor
+public class UserDetailService {
+
+//    private UserDetailRepo userDetailRepo;
+//    private AssetRepo assetRepo;
+//
+//    public Page<UserDetail> all(PageQuery pageQuery) {
+//        return userDetailRepo.findAll(JpaUtils.toSpecification(pageQuery, UserDetail.class), JpaUtils.toPageRequest(pageQuery));
+//    }
+
+//    public Map<String,Long> userHoldCount(Long userId) {
+//        //查询绿洲元宇宙建筑
+//        Long count = assetRepo.findDiscount()
+//    }
+}

+ 1 - 1
src/main/java/com/izouma/nineth/service/UserService.java

@@ -166,7 +166,7 @@ public class UserService {
         }
         if (StringUtils.isNotBlank(intro)) {
             if (!intro.equals(user.getIntro())) {
-                if (!contentAuditService.auditText(nickname)) {
+                if (!contentAuditService.auditText(intro)) {
                     throw new BusinessException("简介包含非法内容");
                 }
             }

+ 75 - 0
src/main/java/com/izouma/nineth/web/UserDetailController.java

@@ -0,0 +1,75 @@
+package com.izouma.nineth.web;
+
+import com.izouma.nineth.domain.UserDetail;
+import com.izouma.nineth.service.ContentAuditService;
+import com.izouma.nineth.service.UserDetailService;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.utils.ObjUtils;
+import com.izouma.nineth.utils.SecurityUtils;
+import com.izouma.nineth.utils.excel.ExcelUtils;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
+import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.Authentication;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/userDetail")
+@AllArgsConstructor
+public class UserDetailController extends BaseController {
+//    private UserDetailService userDetailService;
+//    private UserDetailRepo userDetailRepo;
+//    private ContentAuditService contentAuditService;
+//
+//    //@PreAuthorize("hasRole('ADMIN')")
+//    @PostMapping("/save")
+//    public UserDetail save(@RequestBody UserDetail record) {
+//        Long currentUserId = SecurityUtils.getAuthenticatedUser().getId();
+//        if (currentUserId != record.getUserId()) {
+//            throw new BusinessException("当前修改用户与登录用户不一致");
+//        }
+//        if (StringUtils.isNotBlank(record.getAutograph())) {
+//            if (!contentAuditService.auditText(record.getAutograph())) {
+//                throw new BusinessException("简介包含非法内容");
+//            }
+//        }
+//        if (record.getUserId() != null) {
+//            UserDetail orig = userDetailRepo.findById(record.getUserId()).orElseThrow(new BusinessException("无记录"));
+//            ObjUtils.merge(orig, record);
+//            return userDetailRepo.save(orig);
+//        }
+//        return userDetailRepo.save(record);
+//    }
+//
+//
+//    //@PreAuthorize("hasRole('ADMIN')")
+//    @PostMapping("/all")
+//    public Page<UserDetail> all(@RequestBody PageQuery pageQuery) {
+//        return userDetailService.all(pageQuery);
+//    }
+//
+//    @GetMapping("/get/{id}")
+//    public UserDetail get(@PathVariable Long id) {
+//        return userDetailRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+//    }
+//
+//    @PostMapping("/del/{id}")
+//    public void del(@PathVariable Long id) {
+//        userDetailRepo.softDelete(id);
+//    }
+//
+//    @GetMapping("/excel")
+//    @ResponseBody
+//    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+//        List<UserDetail> data = all(pageQuery).getContent();
+//        ExcelUtils.export(response, data);
+//    }
+}
+

+ 1 - 0
src/main/resources/static/u9s1658vPf.txt

@@ -0,0 +1 @@
+c093b42ff5429c47b4203f2736ba05c4

+ 20 - 20
src/main/vue/src/views/Admin.vue

@@ -217,26 +217,26 @@ export default {
                                 root: false,
                                 active: true
                             },
-                            {
-                                id: '3410339',
-                                name: '空投',
-                                path: '/airDropList',
-                                icon: '',
-                                sort: 43,
-                                parent: '3410316',
-                                root: false,
-                                active: true
-                            },
-                            {
-                                id: '3410345',
-                                name: '兑换券',
-                                path: '/couponList',
-                                icon: '',
-                                sort: 44,
-                                parent: '3410316',
-                                root: false,
-                                active: true
-                            },
+                            // {
+                            //     id: '3410339',
+                            //     name: '空投',
+                            //     path: '/airDropList',
+                            //     icon: '',
+                            //     sort: 43,
+                            //     parent: '3410316',
+                            //     root: false,
+                            //     active: true
+                            // },
+                            // {
+                            //     id: '3410345',
+                            //     name: '兑换券',
+                            //     path: '/couponList',
+                            //     icon: '',
+                            //     sort: 44,
+                            //     parent: '3410316',
+                            //     root: false,
+                            //     active: true
+                            // },
                             {
                                 id: '3410399',
                                 name: '铸造者',

+ 3 - 2
src/main/vue/src/views/CollectionEdit.vue

@@ -166,7 +166,7 @@
                             </el-input-number>
                         </el-form-item>
                         <el-form-item prop="serviceCharge" label="手续费(%)">
-                            <el-input-number v-model="formData.serviceCharge" :min="0" :max="99" :disabled="!canEdit">
+                            <el-input-number v-model="formData.serviceCharge" :min="0" :max="99" :disabled="!canEdit || isCompany">
                             </el-input-number>
                         </el-form-item>
                     </div>
@@ -480,7 +480,8 @@ export default {
                 couponPayment: false,
                 chainFlag: 3,
                 vip: false,
-                messNumber: false
+                messNumber: false,
+                serviceCharge: 5
             },
             rules: {
                 name: [