bat1

1
2
3
4
5
6
7
8
9
@echo off
set /a ye = %date:~0,4%+0
set /a mo = 1%date:~5,2%-100
set /a da = 1%date:~8,2%-100
set /a ho = %time:~0,2%
set /a mi = 1%time:~3,2%-100
set /a pwd = %ye% + %mo% + %da% + %ho% + %mi%
echo %pwd%
pause

月日分秒,截取2位,如果0开头会识别为八进制。

这样前面加1变成一百零几,再减100就完事了。

idea控制台输出文字颜色

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public class Color {
public static void main(String[] args) {
System.out.println("\033[30;1m" + "白b" + "\033[0m");
System.out.println("\033[31;m" + "红" + "\033[0m");
System.out.println("\033[32;m" + "绿" + "\033[0m");
System.out.println("\033[33;4m" + "黄u" + "\033[0m");
System.out.println("\033[34;4m" + "蓝u" + "\033[0m");
System.out.println("\033[35;4m" + "紫u" + "\033[0m");
System.out.println("\033[36;4m" + "青u" + "\033[0m");
System.out.println("\033[37;4m" + "灰u" + "\033[0m");
System.out.println("\033[40;31;4m" + "白底红u" + "\033[0m");
System.out.println("\033[41;32;4m" + "红底绿u" + "\033[0m");
System.out.println("\033[42;33;4m" + "绿底黄u" + "\033[0m");
System.out.println("\033[43;34;4m" + "黄底蓝u" + "\033[0m");
System.out.println("\033[44;35;4m" + "蓝底紫u" + "\033[0m");
System.out.println("\033[45;36;4m" + "紫底青u" + "\033[0m");
System.out.println("\033[46;37;4m" + "青底灰u" + "\033[0m");
System.out.println("\033[47;4m" + "灰底u" + "\033[0m");
System.out.println("\033[31;1m" + "红B" + "\033[0m");
System.out.println("\033[1;4m" + "uB" + "\033[0m");
System.out.println("\033[1;7;4m" + "反色-uB" + "\033[0m");
System.out.println("\033[40;31;1;7;4m" + "反色-白底红uB" + "\033[0m");
}
}

时间区间

1
SELECT date_format( billGenerateTime, '%Y-%m-%d' )  FROM charge_record where date_format( billGenerateTime, '%Y-%m-%d' ) BETWEEN '2017-10-1' and '2019-12-31';

1
SELECT date_format( billGenerateTime, '%Y-%m' )  FROM charge_record where date_format( billGenerateTime, '%Y-%m' ) BETWEEN '2017-10' and '2019-12';

1
SELECT date_format( billGenerateTime, '%Y' )  FROM charge_record where date_format( billGenerateTime, '%Y' ) BETWEEN '2017' and '2019';

postman用globals封装自定义函数

0.准备工作

首先,我的Postman版本

是 Postman for Windows
Version 7.6.0
win32 10.0.17134 / x64

然后,准备需要封装的JS代码。自定义函数如下。

function getOneName(type) {
    var someoneArray = new Array("蕊", "薇", "菁", "梦", "岚", "苑", "婕", "馨", "瑗", "琰", "韵", "融", "园", "艺", "咏", "卿", "聪", "澜", "纯", "爽", "琬", "茗", "羽", "希", "宁", "欣", "飘", "育", "滢", "馥", "筠", "柔", "竹", "霭", "凝", "晓", "欢", "霄", "伊", "亚", "宜", "可", "姬", "舒", "影", "荔", "枝", "思", "丽", "芬", "芳", "燕", "莺", "媛", "艳", "珊", "莎", "蓉", "眉", "君", "琴", "毓", "悦", "昭", "冰", "枫", "芸", "菲", "寒", "锦", "玲", "秋", "秀", "娟", "英", "华", "慧", "巧", "美", "娜", "静", "淑", "惠", "珠", "翠", "雅", "芝", "玉", "萍", "红", "月", "彩", "春", "菊", "兰", "凤", "洁", "梅", "琳", "素", "云", "莲", "真", "环", "雪", "荣", "爱", "妹", "霞", "香", "凡", "佳", "嘉", "琼", "勤", "珍", "贞", "莉", "桂", "娣", "叶", "璧", "璐", "娅", "琦", "晶", "妍", "茜", "黛", "青", "倩", "婷", "姣", "婉", "娴", "瑾", "颖", "露", "瑶", "怡", "婵", "雁", "蓓", "纨", "仪", "荷", "丹");
    var somethingArray = new Array("刀", "枪", "剑", "戟", "斧", "钺", "钩", "叉", "鞭", "锏", "锤", "挝", "镋", "棍", "槊", "棒", "拐", "流星");
    var adjArray = new Array("好", "坏", "伟大", "勇敢", "优秀", "聪明", "老实", "鲁莽", "大方", "软", "硬", "苦", "甜", "冷", "热", "坚固", "平常", "长", "短", "大", "小", "粗", "细", "红", "绿", "平坦", "整齐", "雪白", "笔直", "绿油油", "血淋淋", "骨碌碌", "黑不溜秋", "快", "慢", "全", "整", "多", "少");
    var advArray = new Array("非常", "绝对", "极度", "十分", "最", "顶级", "太", "更", "极其", "格外", "分外", "一直", "总", "生动", "熟练", "轻松", "清楚", "马虎", "干脆", "许多");
    var vArray = new Array("搀", "抱", "搂", "扶", "捉", "擒", "掐", "推", "拿", "抽", "撕", "摘", "拣", "捡", "打", "播", "击", "捏", "撒", "按", "弹", "撞", "提", "扭", "捶", "持", "揍", "披", "捣", "搜", "托", "举", "拖", "擦", "敲", "挖", "抛", "掘", "抬", "插", "扔", "写", "抄", "抓", "捧", "掷", "撑", "摊", "倒", "摔", "劈", "画", "搔", "撬", "挥", "揽", "挡", "捺", "抚", "搡", "拉", "摸", "拍", "摇", "剪", "拎", "拔", "拧", "拨", "舞", "握", "攥");
    var objectArray = new Array("头", "喉", "胸", "肚", "腹", "腿", "脖", "肩", "背", "腰", "臀", "手", "脚");
    var nickArray = new Array("儿", "子", "君", "酱");
    var n;
    var prefix;
    if (type === 0) {
        prefix = objectArray[(Math.random() * (objectArray.length - 1)).round()] + advArray[(Math.random() * (advArray.length - 1)).round()] + adjArray[(Math.random() * (adjArray.length - 1)).round()];
        n = "的" + someoneArray[(Math.random() * (someoneArray.length - 1)).round()] + nickArray[(Math.random() * (nickArray.length - 1)).round()];
    } else if (type === 1) {
        prefix = advArray[(Math.random() * (advArray.length - 1)).round()] + vArray[(Math.random() * (vArray.length - 1)).round()] + objectArray[(Math.random() * (objectArray.length - 1)).round()] + adjArray[(Math.random() * (adjArray.length - 1)).round()];
        n = "之" + somethingArray[(Math.random() * (somethingArray.length - 1)).round()];
    } else if (type === 2) {
        prefix = advArray[(Math.random() * (advArray.length - 1)).round()] + vArray[(Math.random() * (vArray.length - 1)).round()] + objectArray[(Math.random() * (objectArray.length - 1)).round()] + adjArray[(Math.random() * (adjArray.length - 1)).round()];
        n = "";
    }
    return prefix + n;
}

1.将自定义函数放入全局变量

首先,把代码格式化,引号转义。

function getOneName(type){var someoneArray=new Array(\"蕊\",\"薇\",\"菁\",\"梦\",\"岚\",\"苑\",\"婕\",\"馨\",\"瑗\",\"琰\",\"韵\",\"融\",\"园\",\"艺\",\"咏\",\"卿\",\"聪\",\"澜\",\"纯\",\"爽\",\"琬\",\"茗\",\"羽\",\"希\",\"宁\",\"欣\",\"飘\",\"育\",\"滢\",\"馥\",\"筠\",\"柔\",\"竹\",\"霭\",\"凝\",\"晓\",\"欢\",\"霄\",\"伊\",\"亚\",\"宜\",\"可\",\"姬\",\"舒\",\"影\",\"荔\",\"枝\",\"思\",\"丽\",\"芬\",\"芳\",\"燕\",\"莺\",\"媛\",\"艳\",\"珊\",\"莎\",\"蓉\",\"眉\",\"君\",\"琴\",\"毓\",\"悦\",\"昭\",\"冰\",\"枫\",\"芸\",\"菲\",\"寒\",\"锦\",\"玲\",\"秋\",\"秀\",\"娟\",\"英\",\"华\",\"慧\",\"巧\",\"美\",\"娜\",\"静\",\"淑\",\"惠\",\"珠\",\"翠\",\"雅\",\"芝\",\"玉\",\"萍\",\"红\",\"月\",\"彩\",\"春\",\"菊\",\"兰\",\"凤\",\"洁\",\"梅\",\"琳\",\"素\",\"云\",\"莲\",\"真\",\"环\",\"雪\",\"荣\",\"爱\",\"妹\",\"霞\",\"香\",\"凡\",\"佳\",\"嘉\",\"琼\",\"勤\",\"珍\",\"贞\",\"莉\",\"桂\",\"娣\",\"叶\",\"璧\",\"璐\",\"娅\",\"琦\",\"晶\",\"妍\",\"茜\",\"黛\",\"青\",\"倩\",\"婷\",\"姣\",\"婉\",\"娴\",\"瑾\",\"颖\",\"露\",\"瑶\",\"怡\",\"婵\",\"雁\",\"蓓\",\"纨\",\"仪\",\"荷\",\"丹\");var somethingArray=new Array(\"刀\",\"枪\",\"剑\",\"戟\",\"斧\",\"钺\",\"钩\",\"叉\",\"鞭\",\"锏\",\"锤\",\"挝\",\"镋\",\"棍\",\"槊\",\"棒\",\"拐\",\"流星\");var adjArray=new Array(\"好\",\"坏\",\"伟大\",\"勇敢\",\"优秀\",\"聪明\",\"老实\",\"鲁莽\",\"大方\",\"软\",\"硬\",\"苦\",\"甜\",\"冷\",\"热\",\"坚固\",\"平常\",\"长\",\"短\",\"大\",\"小\",\"粗\",\"细\",\"红\",\"绿\",\"平坦\",\"整齐\",\"雪白\",\"笔直\",\"绿油油\",\"血淋淋\",\"骨碌碌\",\"黑不溜秋\",\"快\",\"慢\",\"全\",\"整\",\"多\",\"少\");var advArray=new Array(\"非常\",\"绝对\",\"极度\",\"十分\",\"最\",\"顶级\",\"太\",\"更\",\"极其\",\"格外\",\"分外\",\"一直\",\"总\",\"生动\",\"熟练\",\"轻松\",\"清楚\",\"马虎\",\"干脆\",\"许多\");var vArray=new Array(\"搀\",\"抱\",\"搂\",\"扶\",\"捉\",\"擒\",\"掐\",\"推\",\"拿\",\"抽\",\"撕\",\"摘\",\"拣\",\"捡\",\"打\",\"播\",\"击\",\"捏\",\"撒\",\"按\",\"弹\",\"撞\",\"提\",\"扭\",\"捶\",\"持\",\"揍\",\"披\",\"捣\",\"搜\",\"托\",\"举\",\"拖\",\"擦\",\"敲\",\"挖\",\"抛\",\"掘\",\"抬\",\"插\",\"扔\",\"写\",\"抄\",\"抓\",\"捧\",\"掷\",\"撑\",\"摊\",\"倒\",\"摔\",\"劈\",\"画\",\"搔\",\"撬\",\"挥\",\"揽\",\"挡\",\"捺\",\"抚\",\"搡\",\"拉\",\"摸\",\"拍\",\"摇\",\"剪\",\"拎\",\"拔\",\"拧\",\"拨\",\"舞\",\"握\",\"攥\");var objectArray=new Array(\"头\",\"喉\",\"胸\",\"肚\",\"腹\",\"腿\",\"脖\",\"肩\",\"背\",\"腰\",\"臀\",\"手\",\"脚\");var nickArray=new Array(\"儿\",\"子\",\"君\",\"酱\");var n;var prefix;if(type===0){prefix=objectArray[(Math.random()*(objectArray.length-1)).round()]+advArray[(Math.random()*(advArray.length-1)).round()]+adjArray[(Math.random()*(adjArray.length-1)).round()];n=\"的\"+someoneArray[(Math.random()*(someoneArray.length-1)).round()]+nickArray[(Math.random()*(nickArray.length-1)).round()];}else if(type===1){prefix=advArray[(Math.random()*(advArray.length-1)).round()]+vArray[(Math.random()*(vArray.length-1)).round()]+objectArray[(Math.random()*(objectArray.length-1)).round()]+adjArray[(Math.random()*(adjArray.length-1)).round()];n=\"之\"+somethingArray[(Math.random()*(somethingArray.length-1)).round()];}else if(type===2){prefix=advArray[(Math.random()*(advArray.length-1)).round()]+vArray[(Math.random()*(vArray.length-1)).round()]+objectArray[(Math.random()*(objectArray.length-1)).round()]+adjArray[(Math.random()*(adjArray.length-1)).round()];n=\"\";}return prefix+n;}"

在Pre-req.里面将这段代码放入全局变量pm.globals.set(“key”,”value”)。

pm.globals.set("getOneName", "function getOneName(type){var someoneArray=new Array(\"蕊\",\"薇\",\"菁\",\"梦\",\"岚\",\"苑\",\"婕\",\"馨\",\"瑗\",\"琰\",\"韵\",\"融\",\"园\",\"艺\",\"咏\",\"卿\",\"聪\",\"澜\",\"纯\",\"爽\",\"琬\",\"茗\",\"羽\",\"希\",\"宁\",\"欣\",\"飘\",\"育\",\"滢\",\"馥\",\"筠\",\"柔\",\"竹\",\"霭\",\"凝\",\"晓\",\"欢\",\"霄\",\"伊\",\"亚\",\"宜\",\"可\",\"姬\",\"舒\",\"影\",\"荔\",\"枝\",\"思\",\"丽\",\"芬\",\"芳\",\"燕\",\"莺\",\"媛\",\"艳\",\"珊\",\"莎\",\"蓉\",\"眉\",\"君\",\"琴\",\"毓\",\"悦\",\"昭\",\"冰\",\"枫\",\"芸\",\"菲\",\"寒\",\"锦\",\"玲\",\"秋\",\"秀\",\"娟\",\"英\",\"华\",\"慧\",\"巧\",\"美\",\"娜\",\"静\",\"淑\",\"惠\",\"珠\",\"翠\",\"雅\",\"芝\",\"玉\",\"萍\",\"红\",\"月\",\"彩\",\"春\",\"菊\",\"兰\",\"凤\",\"洁\",\"梅\",\"琳\",\"素\",\"云\",\"莲\",\"真\",\"环\",\"雪\",\"荣\",\"爱\",\"妹\",\"霞\",\"香\",\"凡\",\"佳\",\"嘉\",\"琼\",\"勤\",\"珍\",\"贞\",\"莉\",\"桂\",\"娣\",\"叶\",\"璧\",\"璐\",\"娅\",\"琦\",\"晶\",\"妍\",\"茜\",\"黛\",\"青\",\"倩\",\"婷\",\"姣\",\"婉\",\"娴\",\"瑾\",\"颖\",\"露\",\"瑶\",\"怡\",\"婵\",\"雁\",\"蓓\",\"纨\",\"仪\",\"荷\",\"丹\");var somethingArray=new Array(\"刀\",\"枪\",\"剑\",\"戟\",\"斧\",\"钺\",\"钩\",\"叉\",\"鞭\",\"锏\",\"锤\",\"挝\",\"镋\",\"棍\",\"槊\",\"棒\",\"拐\",\"流星\");var adjArray=new Array(\"好\",\"坏\",\"伟大\",\"勇敢\",\"优秀\",\"聪明\",\"老实\",\"鲁莽\",\"大方\",\"软\",\"硬\",\"苦\",\"甜\",\"冷\",\"热\",\"坚固\",\"平常\",\"长\",\"短\",\"大\",\"小\",\"粗\",\"细\",\"红\",\"绿\",\"平坦\",\"整齐\",\"雪白\",\"笔直\",\"绿油油\",\"血淋淋\",\"骨碌碌\",\"黑不溜秋\",\"快\",\"慢\",\"全\",\"整\",\"多\",\"少\");var advArray=new Array(\"非常\",\"绝对\",\"极度\",\"十分\",\"最\",\"顶级\",\"太\",\"更\",\"极其\",\"格外\",\"分外\",\"一直\",\"总\",\"生动\",\"熟练\",\"轻松\",\"清楚\",\"马虎\",\"干脆\",\"许多\");var vArray=new Array(\"搀\",\"抱\",\"搂\",\"扶\",\"捉\",\"擒\",\"掐\",\"推\",\"拿\",\"抽\",\"撕\",\"摘\",\"拣\",\"捡\",\"打\",\"播\",\"击\",\"捏\",\"撒\",\"按\",\"弹\",\"撞\",\"提\",\"扭\",\"捶\",\"持\",\"揍\",\"披\",\"捣\",\"搜\",\"托\",\"举\",\"拖\",\"擦\",\"敲\",\"挖\",\"抛\",\"掘\",\"抬\",\"插\",\"扔\",\"写\",\"抄\",\"抓\",\"捧\",\"掷\",\"撑\",\"摊\",\"倒\",\"摔\",\"劈\",\"画\",\"搔\",\"撬\",\"挥\",\"揽\",\"挡\",\"捺\",\"抚\",\"搡\",\"拉\",\"摸\",\"拍\",\"摇\",\"剪\",\"拎\",\"拔\",\"拧\",\"拨\",\"舞\",\"握\",\"攥\");var objectArray=new Array(\"头\",\"喉\",\"胸\",\"肚\",\"腹\",\"腿\",\"脖\",\"肩\",\"背\",\"腰\",\"臀\",\"手\",\"脚\");var nickArray=new Array(\"儿\",\"子\",\"君\",\"酱\");var n;var prefix;if(type===0){prefix=objectArray[(Math.random()*(objectArray.length-1)).round()]+advArray[(Math.random()*(advArray.length-1)).round()]+adjArray[(Math.random()*(adjArray.length-1)).round()];n=\"的\"+someoneArray[(Math.random()*(someoneArray.length-1)).round()]+nickArray[(Math.random()*(nickArray.length-1)).round()];}else if(type===1){prefix=advArray[(Math.random()*(advArray.length-1)).round()]+vArray[(Math.random()*(vArray.length-1)).round()]+objectArray[(Math.random()*(objectArray.length-1)).round()]+adjArray[(Math.random()*(adjArray.length-1)).round()];n=\"之\"+somethingArray[(Math.random()*(somethingArray.length-1)).round()];}else if(type===2){prefix=advArray[(Math.random()*(advArray.length-1)).round()]+vArray[(Math.random()*(vArray.length-1)).round()]+objectArray[(Math.random()*(objectArray.length-1)).round()]+adjArray[(Math.random()*(adjArray.length-1)).round()];n=\"\";}return prefix+n;}");

2.引用全局变量中的封装函数

在其他请求的Pre-req.中引用自定义函数

//获取起名器 
eval(globals.getOneName);
var myName = getOneName(0);
// 将变量放入环境变量中。
pm.environment.set("myName", myName);

引用环境变量,发送请求。

//变量用{{...}}括起来。
{{domain}}/{{myName}}

2011版课标背诵推荐

关雎

【作者】《诗经》
【朝代】先秦
关关雎鸠,在河之洲。
窈窕淑女,君子好逑。
参差荇菜,左右流之。
窈窕淑女,寤寐求之。
求之不得,寤寐思服。
悠哉悠哉,辗转反侧。
参差荇菜,左右采之。
窈窕淑女,琴瑟友之。
参差荇菜,左右芼之。
窈窕淑女,钟鼓乐之。

Read More