Commit 9f3a3168 authored by liqin's avatar liqin 💬

bug fixed

parent 290dc8c6
......@@ -199,7 +199,7 @@
</where>
</select>
<select id="getuserIdById" resultType="cn.wisenergy.model.app.User">
<select id="getuserIdById" resultType="java.lang.Integer">
select
id
from
......
package cn.wisenergy.model.app;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -17,6 +18,7 @@ import java.util.Date;
@Data
@ApiModel(value = "RecommendUser")
@TableName("recommend_user")
public class RecommendUser implements Serializable {
private static final long serialVersionUID = 7885137366850583004L;
......
package cn.wisenergy.model.app;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -17,6 +18,7 @@ import java.util.Date;
*/
@Data
@ApiModel(value = "User")
@TableName("user_info")
public class User extends Model<User> implements Serializable{
private static final long serialVersionUID = 2525339404301884673L;
......
......@@ -78,11 +78,11 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
@Override
public Map userByZx(String userId, String beInvitedCode) {
//查询数据库,看看是否存在该用户
int yh=usersMapper.getuserIdById(userId);
Integer yh=usersMapper.getuserIdById(userId);
/**
* 判断用户推荐人的邀请码是否为空,空的话填写1
*/
if (null == beInvitedCode || "" == beInvitedCode && 0==yh) {
if (null == beInvitedCode || "".equals(beInvitedCode) && null==yh) {
beInvitedCode = "1";
// 插入用户手机号与推荐人邀请码
......@@ -117,6 +117,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
User user = new User();
user.setInviteCode(inviteCode);
user.setUserLevel(0);
user.setUserId(userId);
usersMapper.updateById(user);
//插入直推用户表
......
......@@ -12,9 +12,7 @@ import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
......@@ -99,11 +97,11 @@ public class UploadController {
@ApiOperation(value = "资讯信息-文字/多图片上传接口", notes = "上传图片,返回路径给前台", httpMethod = "POST", produces = "application/json; charset=UTF-8")
@ApiImplicitParams({
@ApiImplicitParam(name = "zxField", value = "资讯文字", dataType = "String"),
@ApiImplicitParam(name = "file[]", value = "多图片", dataType = "MultipartFile"),
@ApiImplicitParam(name = "files", value = "多图片", paramType = "form", allowMultiple=true, dataType = "__file"),
@ApiImplicitParam(name = "zxAddress", value = "发表地址", dataType = "String"),
@ApiImplicitParam(name = "userId", value = "用户手机号", required = true, dataType = "String")})
@RequestMapping("/multipleImageUpload")
public List multipleImageUpload(MultipartFile[] files, String userId, String zxField, String zxAddress) {
@RequestMapping(method = RequestMethod.POST, value = "/multipleImageUpload", headers = "content-type=multipart/form-data")
public List multipleImageUpload(@RequestParam(value = "files") MultipartFile[] files, String userId, String zxField, String zxAddress) {
return uploadService.imageUpload(files, userId, zxField, zxAddress);
}
......
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