项目(talentcard)笔记之mysql,java代码

切面的简单用法
@Aspect
@Component
public class LogInterceptor {
    @Pointcut("execution(public * com.talentcard.web.controller.*.*(..))")
    public void log() {
    }
    @Before("log()")
    public void deoBefore(JoinPoint joinPoint) {
        System.out.println("!!!!!!!!!!!!");
    }
}
数据库mysql
数据库是t_talent t的card_type(tinyint)和talent_source(int)  对象是byte和Integer
一个页面可以对应多个url请求,得到数据,填充数据
Mysql的CDATA 部分语法: "<![CDATA[" "]]>" :
<![CDATA["原始的sql语句"]]>

好像是子表左连接父表
我测试父表左连接子表会出现数据缺少的情况
微信微服务模块
http 调用
  HttpEntity<String> entity = new HttpEntity<>(jsonObject.toString(), headers);
//jsonObject:map打印出来的是不一样的
 ResponseEntity<JSONObject> responseEntity = restTemplate.exchange(url,
HttpMethod.GET, entity, JSONObject.class);//entity还可以设置header,header还可以设置表单形式发送
“trueString”.equal(testStr)==true;
@RequestHeader String token
com.thoughtworks.xstream.XStream作用:将对象转为xml,将集合转为xml,
<!--JSONObject.fromObject()-->
<dependency>
    <groupId>commons-beanutils</groupId>
    <artifactId>commons-beanutils</artifactId>
    <version>1.9.3</version>
</dependency>

Front模块
Association 用于一对一,

   <resultMap id="TalentResultMap" type="com.talentcard.common.bo.TalentBO">
        <id column="t_talent_id" jdbcType="BIGINT" property="talentId"/>
        <collection property="educationPOList" ofType="com.talentcard.common.pojo.EducationPO">
                <id column="e_educ_id" jdbcType="BIGINT" property="educId"/>
Url,返回类型,参数...,竟然可以直接加参数token
  String userInfo = new RestTemplate().getForObject("url",String.class, AccessTokenUtil.getAccessToken(), openId);
日历得到一天中的最后一天
int Day = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);//31


小程序
MultipartFile file = ((MultipartHttpServletRequest) req).getFile("file"); 类型强转

Web
退出
 // 遍历request中的session,作删除
    Enumeration em = request.getSession().getAttributeNames();
    while (em.hasMoreElements()) {
        request.getSession().removeAttribute(em.nextElement().toString());
    }
生成随机数
 Random r = new Random();
 int n2 = r.nextInt(10);

 ImageIO.write(image, "png",ByteArrayOutputStream baos);
  byte[] bytes = baos.toByteArray();
  string png_base64 = encoder.encodeBuffer(bytes).trim();
生成图片验证码是很成熟,可以参考别人的代码,自己写还是很麻烦的

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值