Commit b941670f by 杨林龙

完成Dubbo基本开发 yangll

1 parent c44ee63e
......@@ -58,7 +58,7 @@ public class PlatformCustomer implements Serializable {
/**
* 城市 sys_area的id
*/
private Integer Area;
private Integer area;
/**
* 详细地址
......@@ -255,11 +255,11 @@ public class PlatformCustomer implements Serializable {
}
public Integer getArea() {
return Area;
return area;
}
public void setArea(Integer area) {
Area = area;
this.area = area;
}
@Override
......@@ -273,7 +273,7 @@ public class PlatformCustomer implements Serializable {
", contactEmail='" + contactEmail + '\'' +
", province=" + province +
", city=" + city +
", Area=" + Area +
", Area=" + area +
", address='" + address + '\'' +
", status=" + status +
", publicKey='" + publicKey + '\'' +
......
......@@ -26,4 +26,6 @@ public interface PlatformCustomerMapper extends OreMapper<PlatformCustomer> {
int login(PlatformCustomer customer);
List<String> getAddressOptionList(@Param("id") int id);
String getAddressStr(@Param("province") Integer province);
}
\ No newline at end of file
......@@ -10,9 +10,7 @@ import com.alibaba.dubbo.config.annotation.Service;
import javax.annotation.Resource;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.util.List;
import java.util.Random;
import java.util.UUID;
@Service
......@@ -60,6 +58,11 @@ public class CustomerMgrServiceImpl implements CustomerMgrService {
PublicKey publicKey = RsaUtil.generatePublicKey(modulus, exponent);
customer.setPrivateKey(privateKey.getAlgorithm());
customer.setPublicKey(publicKey.getAlgorithm());
String province = customerMapper.getAddressStr(customer.getProvince());
String city = customerMapper.getAddressStr(customer.getCity());
String area = customerMapper.getAddressStr(customer.getArea());
customer.setAddress(province + city + area + customer.getAddress());
return customerMapper.insertSelective(customer);
}
......
......@@ -69,4 +69,11 @@
</choose>
</select>
<select id="getAddressStr" resultType="java.lang.String">
select
area_name
from t_sys_area
where id = #{id,jdbcType=INTEGER}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!