Nutz:代码生成器开源了
项目地址: https://github.com/Wizzercn/NutzCodematic
Nutz 代码生成器:
可以生成Pojo类、Action类;
支持MySQL、Oracle、MS SQL2000、ODBC等;
classes是在jdk1.7下编译,可以直接双击 run.bat 运行。
迟迟没放出来的原因是代码写的太烂……
项目地址: https://github.com/Wizzercn/NutzCodematic
Nutz 代码生成器:
可以生成Pojo类、Action类;
支持MySQL、Oracle、MS SQL2000、ODBC等;
classes是在jdk1.7下编译,可以直接双击 run.bat 运行。
迟迟没放出来的原因是代码写的太烂……
怎么说呢,帝国CMS开发起来比较灵活,可是弊端也很多,比如模板、标签、自定义SQL、自定义列表、模型等等,
做起来是相当的麻烦,从这里转到那里,又要自定义函数又要这个那的,,否则怎么会要花近一个月时间做个网站呢?
做网站真的应该是分分钟的事情,而帝国CMS让我花费了超过1/3时间在折腾自定义标签、函数等,边学习边研究边开发。
我不清楚PHPCMS开发要多久,另外那个人说一周加班加点可以搞定。
帝国CMS最人命的是,不光对开发人员不友好,对网站编辑人员更加不友好,,各种麻烦,各种功能不支持,
对不之下,PHPCMS编辑网站起来方便多了,可以裁剪标题图不变形、可以推送文章到广告位等等。
一直是从事JAVA开发的,PHP的CMS也就接触过Wordpress而已,,如果不是老板确定用帝国CMS,
如果不是自己看中帝国自带的商城,打死也不会选择帝国CMS。。。。
难怪官方都不再更新维护了,,体验不是一般的烂,算是浪费时间换得了个教训,望后者不要付后尘。
网易微博登陆验证,第一次请求使用BASE64加密、第二次请求使用MD5+RSA加密,比较变态,于是使用JAVA+JS相结合的方式,调用其JS方法得到加密字符串。
/core1.7.0.js 是经过处理的,删掉几行在JAVA引用中会报错的浏览器对象。
import org.apache.http.HttpResponse;
import org.apache.http.client.CookieStore;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.velocity.util.StringUtils;
import org.nutz.lang.Files;
import org.nutz.lang.util.ClassTools;
import org.nutz.repo.Base64;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
/**
* Created by Wizzer on 14-7-7.
*/
public class Netease {
static String index_url = "http://t.163.com/session";
static String login1_url = "http://reg.163.com/services/httpLoginExchgKeyNew";
static String login2_url = "http://reg.163.com/httpLoginVerifyNew.jsp";
static String status_url = "http://t.163.com/share/check/status";
UrlUtil urlUtil = new UrlUtil();
public static void main(String[] args) {
CookieStore cookieStore = new Netease().login("email", "password");
}
public CookieStore login(String userid, String password) {
try {
DefaultHttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(login1_url + "?rnd=" + Base64.encodeToString(userid.getBytes(), true) + "&jsonp=setLoginStatus");
get.setHeader("Accept", "*/*");
get.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36");
HttpResponse response = client.execute(get);
int code = response.getStatusLine().getStatusCode();
if (code == 200) {
InputStream in = response.getEntity().getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
String line = "", res = "";
while (null != (line = reader.readLine())) {
res += line;
}
System.out.println("res:::" + res);
if (res.contains("200")) {
String[] str = StringUtils.split(urlUtil.getStr(res, "setLoginStatus(\"", "\")"), "\\n");
String o = str[1], h = str[2];
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine se = sem.getEngineByName("javascript");
se.eval(getJs());
String jiami = "";
if (se instanceof Invocable) {
Invocable invoke = (Invocable) se;
jiami = invoke.invokeFunction("getCode",
password, o, h).toString();
System.out.println("jiami = " + jiami);
}
DefaultHttpClient client2 = new DefaultHttpClient();
client2.setCookieStore(client.getCookieStore());
HttpGet get2 = new HttpGet(login2_url + "?rcode=" + jiami + "&product=t&jsonp=setLoginStatus&savelogin=0&username=" + userid);
get2.setHeader("Accept", "*/*");
get2.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36");
HttpResponse response2 = client2.execute(get2);
int code2 = response2.getStatusLine().getStatusCode();
if (code2 == 200) {
InputStream in2 = response2.getEntity().getContent();
BufferedReader reader2 = new BufferedReader(new InputStreamReader(in2));
String line2 = "", res2 = "";
while (null != (line2 = reader2.readLine())) {
res2 += line2;
}
System.out.println("res2:::" + res2);
if (res.contains("200")) {
return client2.getCookieStore();
}
}
}
}
return null;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
private String getJs() {
String jscontent = Files.read(ClassTools.getClassLoader().getResource("").getPath() + "netease" + "/core1.7.0.js");
jscontent += "function getCode(p,o,h){\n" +
"\t\t\t\tvar l=new RSAKey();\n" +
"\t\t\t\tl.setPublic(h,o);\n" +
"\t\t\t\treturn l.encrypt(getMd5(p));\t\t\t\t\n" +
" }";
return jscontent;
}
}
1、使用系统自带的水印系统,勾选即可使用;
2、可勾选生成缩略图。
1、将 uploadify 文件夹解压至 ../e/extend/
2、系统–>数据表与系统模型–>管理数据表–>图片系统数据表–>管理字段–> morepic 修改: 将“输入表单替换html代码.html”文件内容,拷贝替换掉“输入表单替换html代码”
3、搞定。
ps:uploadify.php 第49行,没有用到的,可以删掉提高效率。

下载地址:
1、原版下载(或附件):
http://pan.baidu.com/s/1kTDmdyZ
2、上传时获取照片附加属性(曝光、光圈、相机型号等)版本:
http://pan.baidu.com/s/1qWuLahQ
img { max-width : 800px ; width : expression ( this .width > 800 ? 800 : true ) ; height : auto ; }
HSSFWorkbook wb = new HSSFWorkbook(); OutputStream out = new FileOutputStream(“x.xls”); wb.write(out); out.close(); return new File(“x.xls”);
ByteArrayOutputStream out = new ……..;
wb………
out.close();
ByteArrayInputStream in = new ………..(out.toByte…);
return in;
/e/class/userfun.php
function currentPage($classid,$thisid){
global $class_r;
$fr=explode('|',$class_r[$classid][featherclass]);
$topbclassid=$fr[1]?$fr[1]:$classid;//取得第一级栏目id
if ($topbclassid==$thisid) {
echo "class='cur'";
}
else {
}
}
头部模板:
首先配置好运行环境:
其次修改nginx配置文件:
server {
listen 80;
server_name localhost;
location ~ ^/bbs/.+\.php$ {
alias E:/xuetang/cn/bbs;
rewrite /bbs/(.*\.php?) /$1 break;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME E:/xuetang/cn/bbs$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/bbs($|/.*) {
alias E:/xuetang/cn/bbs/$1;
index index.php index.html index.htm;
}
location / {
root E:/xuetang/cn/www;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
root E:/xuetang/cn/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
注意虚拟目录配置要在根目录上面。。
/**
* 发送post请求
* @param string $url 请求地址
* @param array $post_data post数据
* @return string
*/
function send_post($url, $post_data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($post_data))
);
return curl_exec($ch);
}
"oXS2NuPCEB836NRMrsXXXXXX", "content" => $send_msg);
$data_string = json_encode($data);
echo send_post('http://XXX.cn/api/wx/push/custom/text?mykey=XXXXXX', $data_string);
?>
1、上传文件的文件池路径问题
upload.js
filePool : { type : “cn.xuetang.common.file.FilePool”, args : [“/temp/”, 2000] }
将路径改到项目的路径下
public class FilePool extends NutFilePool {
public FilePool(String homePath, long size) { super(webinfPath(homePath), size); }
private static final String webinfPath(String str) { return Mvcs.getServletContext().getRealPath(“/WEB-INF”)+str; }
}
2、Nutz大字段缓存的问题
.nutz/tmp/dao
将 org.nutz.dao.jdbc.nutz_jdbc_experts.js 拷贝到项目类路径下,修改相应的配置,文件夹不冲突即可。
编写执行文件 job.sh
#!/bin/sh CLASSPATH=classes:lib/druid-1.0.1.jar:lib/htmlparser-1.6.jar:lib/log4j-1.2.17.jar:lib/mysql-connector-java-5.1.26-bin.jar:lib/nutz-1.b.50.jar:lib/ojdbc14.jar:lib/quartz-2.2.1.jar:lib/quartz-jobs-2.2.1.jar:lib/slf4j-api-1.6.6.jar:lib/slf4j-log4j12-1.6.6.jar:lib/sqljdbc4.jar:lib/commons-pool2-2.2.jar: #export CLASSPATH java -classpath $CLASSPATH cn.xuetang.job.MyJob &
赋予job.sh 执行权限
chmod a+x job.sh
后台执行,并把标准输出重定向,关闭终端仍在执行
nohup bash /home/work/ImageTask/job.sh > success.log 2>error.log &
输出在当前控制台,关闭该终端时,将退出启动的进程
/home/work/ImageTask/job.sh
每两分钟启动一次,关闭终端不影响任务
crontab -e
/2 * /home/work/ImageTask/job.sh > success.log 2>error.log &
常用命令
复制文件夹 cp -ri apache-tomcat-7.0.53 /usr/local/tomcat1 删除文件夹 rm -rf 解压文件 tar -xzvf apache-tomcat-7.0.53.tar.gz
安装C++编码环境 yum install -y gcc-c++ 安装HTTP GZIP yum install -y zlib-devel
后台运行
java -jar aaa.jarr &
kill 脚本
kill -15 ps -ef|grep server.jar|grep -v grep |awk '{print $2}'
/usr/local/nginx/sbin/nginx -t #测试配置 /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx -s stop #停止服务器
/usr/local/tomcat1/bin/startup.sh /usr/local/tomcat2/bin/startup.sh /usr/local/tomcat8080/bin/startup.sh
查看端口 netstat -an | grep 80
系统
# uname -a # 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue # 查看操作系统版本 # cat /proc/cpuinfo # 查看CPU信息 # hostname # 查看计算机名 # lspci -tv # 列出所有PCI设备 # lsusb -tv # 列出所有USB设备 # lsmod # 列出加载的内核模块 # env # 查看环境变量
资源
# free -m # 查看内存使用量和交换区使用量 # df -h # 查看各分区使用情况 # du -sh # 查看指定目录的大小 # grep MemTotal /proc/meminfo # 查看内存总量 # grep MemFree /proc/meminfo # 查看空闲内存量 # uptime # 查看系统运行时间、用户数、负载 # cat /proc/loadavg # 查看系统负载
磁盘和分区
# mount | column -t # 查看挂接的分区状态 # fdisk -l # 查看所有分区 # swapon -s # 查看所有交换分区 # hdparm -i /dev/hda # 查看磁盘参数(仅适用于IDE设备) # dmesg | grep IDE # 查看启动时IDE设备检测状况
网络
# ifconfig # 查看所有网络接口的属性 # iptables -L # 查看防火墙设置 # route -n # 查看路由表 # netstat -lntp # 查看所有监听端口 # netstat -antp # 查看所有已经建立的连接 # netstat -s # 查看网络统计信息
进程
# ps -ef # 查看所有进程 # top # 实时显示进程状态
用户
# w # 查看活动用户 # id # 查看指定用户信息 # last # 查看用户登录日志 # cut -d: -f1 /etc/passwd # 查看系统所有用户 # cut -d: -f1 /etc/group # 查看系统所有组 # crontab -l # 查看当前用户的计划任务
服务
# chkconfig --list # 列出所有系统服务 # chkconfig --list | grep on # 列出所有启动的系统服务
程序
# rpm -qa # 查看所有安装的软件包
入口函数: @At public void downImage(@Param(“tvid”) int tvid, HttpServletResponse resp, HttpServletRequest req) {
}
使用Nutz文件池:
Globals.FILE_POOL= new NutFilePool(“~/tmp/myfiles”, 10);
源码:
int i = 0;
File f = Globals.FILE_POOL.createFile(".zip");
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(f.getAbsolutePath()));
for (Weixin_image image : list) {
i++;
String filename = Strings.sNull(bbinfo.get(image.getUid())) + "_" + Strings.sNull(userinfo.get(image.getUid())) + "_" + i+".jpg";
String picurl = image.getPicurl();
if (!Strings.isBlank(image.getImage_url())) {
picurl = image.getImage_url();
}
URL url = new URL(picurl);
try {
URLConnection conn = url.openConnection();
InputStream inStream = conn.getInputStream();
byte[] buffer = new byte[1204];
out.putNextEntry(new ZipEntry(filename));
while ((byteread = inStream.read(buffer)) != -1) {
bytesum += byteread;
out.write(buffer, 0, byteread);
}
out.closeEntry();
inStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
out.close();
resp.setHeader("Content-Length", "" + f.length());
resp.setHeader("Content-Disposition", "attachment; filename=\"" + tvShow.getPlay_name() + ".zip\"");
Streams.writeAndClose(resp.getOutputStream(), Streams.fileIn(f));
仅作参考。 编辑配置Nutz redis配置文件:
var ioc = {
jedisConfig : {
type : 'cn.xuetang.common.redis.JedisConfig',
fields : {
maxTotal : 200,
maxIdle : 10,
maxWaitMillis:10001,
testOnBorrow:true,
redisUrl:'127.0.0.1',
redisPort:6379,
redisTimeout:1000
}
}
}
package cn.xuetang.common.redis;
/**
* Created by Wizzer on 14-4-8.
*/
public class JedisConfig {
private int maxTotal;
private int maxIdle;
private int maxWaitMillis;
private boolean testOnBorrow;
private String redisUrl;
private int redisPort;
private int redisTimeout;//redis断开后自动重新连接间隔时间
public int getMaxTotal() {
return maxTotal;
}
public void setMaxTotal(int maxTotal) {
this.maxTotal = maxTotal;
}
public int getMaxIdle() {
return maxIdle;
}
public void setMaxIdle(int maxIdle) {
this.maxIdle = maxIdle;
}
public int getMaxWaitMillis() {
return maxWaitMillis;
}
public void setMaxWaitMillis(int maxWaitMillis) {
this.maxWaitMillis = maxWaitMillis;
}
public boolean isTestOnBorrow() {
return testOnBorrow;
}
public void setTestOnBorrow(boolean testOnBorrow) {
this.testOnBorrow = testOnBorrow;
}
public String getRedisUrl() {
return redisUrl;
}
public void setRedisUrl(String redisUrl) {
this.redisUrl = redisUrl;
}
public int getRedisPort() {
return redisPort;
}
public void setRedisPort(int redisPort) {
this.redisPort = redisPort;
}
public int getRedisTimeout() {
return redisTimeout;
}
public void setRedisTimeout(int redisTimeout) {
this.redisTimeout = redisTimeout;
}
}
Nutz入口类加载配置文件,config路径:
@Modules(scanPackage=true)
@Ok("raw")
@Fail("http:500")
@IocBy(type=ComboIocProvider.class,args={
"*org.nutz.ioc.loader.json.JsonLoader","config",
"*org.nutz.ioc.loader.annotation.AnnotationIocLoader","cn.xuetang"})
@SetupBy(value=StartSetup.class)
@UrlMappingBy(value=UrlMappingSet.class)
public class MainModule {
}
初始化配置参数,新建订阅消息处理线程:
public static JedisConfig REDIS_CONFIG;
//声明全局的redis连接池
public static ShardedJedisPool SHARDEDJEDIS_POOL=null;
public static JedisPool JEDIS_POOL=null;
public static void InitRedisConfig() {//初始化redis
REDIS_CONFIG = Mvcs.ctx.getDefaultIoc().get(JedisConfig.class);
JedisPoolUtil jedisPoolUtil=new JedisPoolUtil();
SHARDEDJEDIS_POOL = jedisPoolUtil.getShardedJedisPool();
JEDIS_POOL = jedisPoolUtil.getJedisPool();
}
new Thread(Mvcs.getIoc().get(ImageTask.class)).start();
创建Jedis连接池工具类:
package cn.xuetang.common.redis;
import cn.xuetang.common.config.Globals;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.JedisShardInfo;
import redis.clients.jedis.ShardedJedisPool;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Wizzer on 14-4-8.
*/
public class MyJedis {
private String redisUrl;
private int redisPort;
public JedisPoolConfig jedisPoolConfig(){
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
jedisPoolConfig.setMaxTotal(Globals.REDIS_CONFIG.getMaxTotal());
jedisPoolConfig.setMaxIdle(Globals.REDIS_CONFIG.getMaxIdle());
jedisPoolConfig.setMaxWaitMillis(Globals.REDIS_CONFIG.getMaxWaitMillis());
jedisPoolConfig.setTestOnBorrow(Globals.REDIS_CONFIG.isTestOnBorrow());
return jedisPoolConfig;
}
public JedisShardInfo jedisShardInfo(){
return new JedisShardInfo(redisUrl, redisPort);
}
public JedisPool jedisPool(){
return new JedisPool(jedisPoolConfig(),redisUrl, redisPort);
}
public ShardedJedisPool shardedJedisPool(){
this.redisUrl=Globals.REDIS_CONFIG.getRedisUrl();
this.redisPort=Globals.REDIS_CONFIG.getRedisPort();
List jedisList = new ArrayList();
jedisList.add(jedisShardInfo());
return new ShardedJedisPool(jedisPoolConfig(), jedisList);
}
}
实现自己的监听类:
package cn.xuetang.common.redis;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import redis.clients.jedis.JedisPubSub;
/**
* 订阅监听类
* Created by Wizzer on 14-4-8.
*/
public class MyJedisListenter extends JedisPubSub {
private final static Log log = Logs.get();
// 取得订阅的消息后的处理
public void onMessage(String channel, String message) {
log.info(channel + "=" + message);
}
// 初始化订阅时候的处理
public void onSubscribe(String channel, int subscribedChannels) {
log.info(channel + "=" + subscribedChannels);
}
// 取消订阅时候的处理
public void onUnsubscribe(String channel, int subscribedChannels) {
log.info(channel + "=" + subscribedChannels);
}
// 初始化按表达式的方式订阅时候的处理
public void onPSubscribe(String pattern, int subscribedChannels) {
log.info(pattern + "=" + subscribedChannels);
}
// 取消按表达式的方式订阅时候的处理
public void onPUnsubscribe(String pattern, int subscribedChannels) {
log.info(pattern + "=" + subscribedChannels);
}
// 取得按表达式的方式订阅的消息后的处理
public void onPMessage(String pattern, String channel, String message) {
log.info(pattern + "=" + channel + "=" + message);
}
}
获取单例Jedis连接池:
package cn.xuetang.common.redis;
import cn.xuetang.common.config.Globals;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.ShardedJedisPool;
import java.util.Date;
/**
* Created by Wizzer on 14-4-8.
*/
public class JedisPoolUtil {
private final static Log log = Logs.get();
public synchronized ShardedJedisPool getShardedJedisPool() {
if (Globals.SHARDEDJEDIS_POOL == null) {
MyJedis myJedis=new MyJedis();
Globals.SHARDEDJEDIS_POOL = myJedis.shardedJedisPool();
}
return Globals.SHARDEDJEDIS_POOL;
}
public synchronized JedisPool getJedisPool() {
if (Globals.JEDIS_POOL== null) {
MyJedis myJedis=new MyJedis();
Globals.JEDIS_POOL = myJedis.jedisPool();
}
return Globals.JEDIS_POOL;
}
}
数据入列同时发布订阅消息:
ShardedJedis shardedJedis=Globals.SHARDEDJEDIS_POOL.getResource();
txt.put("appid", appInfo.getId());
shardedJedis.lpush("image", Json.toJson(txt));
Jedis jedis=Globals.JEDISPOOL.getResource();
jedis.publish("newimage","true");
处理订阅消息的类:
package cn.xuetang.common.task;
import cn.xuetang.common.action.BaseAction;
import cn.xuetang.common.config.Globals;
import cn.xuetang.common.redis.MyJedisListenter;
import cn.xuetang.common.util.DateUtil;
import cn.xuetang.modules.baby.bean.Baby_image;
import cn.xuetang.modules.baby.bean.Baby_info;
import cn.xuetang.modules.user.bean.User_conn_wx;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.Strings;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.ShardedJedis;
import java.util.*;
/**
* Created by Wizzer on 14-3-31.
*/
@IocBean
public class ImageTask extends BaseAction implements Runnable {
@Inject
protected Dao dao;
private final static Log log = Logs.get();
public void run() {
try {
log.info("ImageTask start!");
final JedisPoolUtil jedisPoolUtil = new JedisPoolUtil();
boolean isEnable = false;
while (!isEnable) {
try {
jedisPoolUtil.getShardedJedisPool().getResource();
isEnable = true;
} catch (Exception e) {
log.info("The redis connection is not successful,wait " + Globals.REDIS_CONFIG.getRedisTimeout() + "ms try again.");
}
try {
wait(Globals.REDIS_CONFIG.getRedisTimeout());
} catch (Exception e) {
}
}
final ShardedJedis shardedJedis = jedisPoolUtil.getShardedJedisPool().getResource();
final Jedis jedis = jedisPoolUtil.getJedisPool().getResource();
MyJedisListenter listenter = new MyJedisListenter() {
@Override
public void onMessage(String channel, String message) {
//业务代码具体实现
while (shardedJedis.exists("image")) {
String data = shardedJedis.rpop("image");
}
}
};
jedis.subscribe(listenter, "newimage");
} catch (Exception e) {
log.error(e);
}
}
}
Request req = Request.create("http://127.0.0.1/api/user/sendtext?mykey=" + mykey, Request.METHOD.POST);
JsonFormat jsonFormat=new JsonFormat();
jsonFormat.setAutoUnicode(true);//防止中文乱码,以unicode编码,根据需要设置
req.setData(Json.toJson(map,jsonFormat));
req.getHeader().set("Content-Type","application/octet-stream");//设置以字节流传送数据
Response resp = Sender.create(req).send();
if (resp.isOK()) {
log.info(resp.getContent());
}
昨天在公交车站等车,看见一小孩子拿了一大包巧克力在吃,一会儿吃了半袋子。我出于好心说了句:小孩子巧克力不能多吃,吃多了会得病。小孩子对我说:我爷爷今年103岁了。我说:因为吃巧克力?小孩说:不是,因为他从来不管闲事。
领导在门外用门夹核桃,我从门口路过,顺嘴说了一句,用门夹过的核桃还能补脑吗?领导愣了愣,把核桃扔垃圾篓了。刚经过领导电脑桌前,看到领导在百度:门夹过的核桃为什么不能补脑?我滴个天哪,度娘你可给点靠谱答案吧,不然他不得揍死我啊。ps,领导刚从美国回来不久。。。。