|
@@ -19,12 +19,12 @@ import org.apache.commons.lang3.time.DateUtils;
|
|
|
import org.joda.time.Days;
|
|
import org.joda.time.Days;
|
|
|
import org.joda.time.LocalDate;
|
|
import org.joda.time.LocalDate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.core.io.ClassPathResource;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
import javax.imageio.ImageIO;
|
|
|
import java.awt.*;
|
|
import java.awt.*;
|
|
|
import java.awt.image.BufferedImage;
|
|
import java.awt.image.BufferedImage;
|
|
|
-import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
@@ -166,9 +166,9 @@ public class TeamService {
|
|
|
public BufferedImage recruitImg(Long userId) throws IOException, FontFormatException, WxErrorException {
|
|
public BufferedImage recruitImg(Long userId) throws IOException, FontFormatException, WxErrorException {
|
|
|
UserInfo userInfo = userInfoRepository.findById(userId).orElseThrow(new ServiceException("用户不存在"));
|
|
UserInfo userInfo = userInfoRepository.findById(userId).orElseThrow(new ServiceException("用户不存在"));
|
|
|
|
|
|
|
|
- Font pingFangRegular = Font.createFont(Font.TRUETYPE_FONT, new File(ClassLoader.getSystemResource("static/PingFangRegular.ttf").getFile()));
|
|
|
|
|
- Font pingFangMedium = Font.createFont(Font.TRUETYPE_FONT, new File(ClassLoader.getSystemResource("static/PingFangMedium.ttf").getFile()));
|
|
|
|
|
- Font robot = Font.createFont(Font.TRUETYPE_FONT, new File(ClassLoader.getSystemResource("static/Roboto-Black.ttf").getFile()));
|
|
|
|
|
|
|
+ Font pingFangRegular = Font.createFont(Font.TRUETYPE_FONT, new ClassPathResource("static/PingFangRegular.ttf").getFile());
|
|
|
|
|
+ Font pingFangMedium = Font.createFont(Font.TRUETYPE_FONT, new ClassPathResource("static/PingFangMedium.ttf").getFile());
|
|
|
|
|
+ Font robot = Font.createFont(Font.TRUETYPE_FONT, new ClassPathResource("static/Roboto-Black.ttf").getFile());
|
|
|
BufferedImage shareImg = ImageIO.read(ClassLoader.getSystemResource("static/share_img.png"));
|
|
BufferedImage shareImg = ImageIO.read(ClassLoader.getSystemResource("static/share_img.png"));
|
|
|
Graphics2D g = shareImg.createGraphics();
|
|
Graphics2D g = shareImg.createGraphics();
|
|
|
g.setComposite(AlphaComposite.Src);
|
|
g.setComposite(AlphaComposite.Src);
|