blob: f6ca8a6d4d93afdd597c614a46dbaffeb567752f [file] [log] [blame]
Sure2338188c5d2025-05-28 11:43:06 +08001package com.pt5.pthouduan.service;
2
3import com.pt5.pthouduan.entity.Invites;
4import com.pt5.pthouduan.mapper.InvitesMapper;
5import org.springframework.beans.factory.annotation.Autowired;
6import org.springframework.stereotype.Service;
7
8import java.util.HashMap;
9import java.util.Map;
10
11@Service
12public class InviteService {
13 @Autowired
14 private InvitesMapper invitesMapper;
15 //批量生成邀请码并存入数据库(6位)(这个直接在数据库更新)
16 //邀请码卖出(set buyername)
17 public Map<String, Object> setbuyername(String buyername){
18 Map<String, Object> result = new HashMap<>();
19 Invites invite=invitesMapper.selectFirstEmptyBuyername();
20 invitesMapper.updatebuyer(invite.getCode(),buyername);
21 result.put("success", true);
22 result.put("invitecode", invite.getCode());
23 result.put("message", "邀请码购买成功");
24 return result;
25 }
26
27
28}